//这题需要注意就是:它给出的名字的排序是逆序来的!
#include "iostream"
#include "string"
using namespace std;
int main()
{
int testcase, num, i, ans;
string name, str[110];
cin >> testcase;
while (testcase--)
{
cin >> num >> name;
for (i = 0; i < 110; i++)
str[i] = "";
ans = 0;
for (i = 0; i < num; i++)
cin >> str[i];
for (i = 0; i < num; i++)//找出其在名字串中的位置!
if (str[i] == name)
break;
ans = (i + num/2) % num;//求得在名字串中的位置!
cout << str[ans] << endl;
}
}
zoj 3492 Kagome Kagome
最新推荐文章于 2016-04-21 17:58:51 发布