Title description
Xiaoyong and Xiaoshi are good friends, they often play together. The game they play today is this: there is a floor made of square stones, its height is 2, and its length is N. For example, the following is the case of N = 3:
Now they take turns to put rectangular stones with length and width of 1 and 2 on them, either horizontally or vertically, but they should be laid on the two uncovered square stones on the floor, when someone cannot Then he lost.
For example, a game may be like this, Xiaoshi horizontally laid stones on the top left, as follows:
Then Xiaoyong horizontally laid stones on the bottom right, as follows:
At this time, Xiao Shi could no longer put stones, so he lost. Xiaoyong is more polite, he let Xiaoshi release first. Of course, the above method may not be the best. Now if they are extremely clever, please program to determine who will win.
Input
An integer C (1 <= C <= 100) in the first line indicates the number of test data. Next there is line C, each line is a test data, each test data only has an integer N (1 <= N <= 100).
Output
Line C is output, and each line outputs the result of the corresponding test data. For each result, if Xiaoyong wins, xiaoyong is output, otherwise Xiaoshi wins, and xiaoshi is output.
Sample input
1
1
Sample output
xiaoshi
analysis
Very clever!
In fact, looking for the law, you can find that n is an odd number, which means small real wins, and even number means Xiaoyong wins
.
Code on
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int c,n;
int main()
{
freopen("game.in","r",stdin);
freopen("game.out","w",stdout);
cin>>c;
for(int i=1;i<=c;i++)
{
cin>>n;
if(n%2!=0) cout<<"xiaoshi"<<endl;
else if(n%2==0) cout<<"xiaoyong"<<endl;
}
fclose(stdin);
fclose(stdout);
return 0;
}