The 8th Zhejiang Provincial Collegiate Programming Contest-> Kagome Kagome
来源:互联网 发布:结巴分词 java 编辑:程序博客网 时间:2024/04/19 13:55
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3492
题意:n个人手拉手围成一圈,然后输出给出的那个的名字的对面的人的名字。n是偶数,如果给出的名字是排第i,i
#include<stdio.h>#include<string.h>int main(void) { int T; scanf("%d",&T); while(T--) { int n,i=1,k; char juzi[120],sample[120][1000]; scanf("%d",&n); getchar(); scanf("%s",juzi); while(i<=n) { scanf("%s",sample[i]); if(strcmp(juzi, sample[i])==0) { k=i; } i++; } if(k>n/2) k=k-n/2; else k=k+n/2; puts(sample[k]); }}
0 0
- The 8th Zhejiang Provincial Collegiate Programming Contest-> Kagome Kagome
- The 8th Zhejiang Provincial Collegiate Programming Contest / F - Kagome Kagome
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest
- The 8th Zhejiang Provincial Collegiate Programming Contest->L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest->M - Median
- The 7th Zhejiang Provincial Collegiate Programming Contest
- The 6th Zhejiang Provincial Collegiate Programming Contest
- The 9th Zhejiang Provincial Collegiate Programming Contest
- The 5th Zhejiang Provincial Collegiate Programming Contest 部分题解
- The 10th Zhejiang Provincial Collegiate Programming Contest Solution
- The 11th Zhejiang Provincial Collegiate Programming Contest---Talented Chef
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 12th Zhejiang Provincial Collegiate Programming Contest
- Java集合:TreeMap使用详解及源码分析
- js基础回顾-对象数组篇
- leetcode:贪心与动态规划
- leetcode 122. Best Time to Buy and Sell Stock II 股票买卖最佳时间(二)
- java基础
- The 8th Zhejiang Provincial Collegiate Programming Contest-> Kagome Kagome
- Linux运维文本处理工具grep与egrep
- DAO中,如何获取子类带泛型的父类的参数
- JQuery编程demo练习
- HDU 5642 King's Order(dp)
- centos6.5下Mysql更改密码
- 杭电1002模板1-用char[]
- 苹果公司账号过期
- 转载:博客园文章