Play a game
Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 1430 accepted submission (s): 1168
Problem descriptionnew year is coming!
Ailyanlu is very happy today! And he is playing a chessboard game With 8600.
The size of the chessboard is N * n. A stone is placed in a corner square. they play alternatively With 8600 having the first move. each time, player is allowed to move the stone to an unvisited neighbor square horizontally or vertically. the one who can't make a move will lose the game. if both play perfectly, who will win the game?
Inputthe input is a sequence of positive integers each in a separate line.
The integers are between 1 and 10000, inclusive, (means 1 <= n <= 10000) indicating the size of the chessboard. The end of the input is indicated by a zero.
Outputoutput the winner ("8600" or "ailyanlu") for each input line handle t the last zero.
No other characters shoshould be inserted in the output.
Sample input20
Sample output8600
Authorailyanlu
Sourcehappy 2007
Recommend8600 | we have carefully selected several similar problems for you: 1404 1536 1517 1524 the regular expression is that if it is an odd number, it will be used to win the game. If it is an even number, it is assumed that you want to search =
1 #include<cstdio> 2 #include<cstring> 3 #include<stdlib.h> 4 #include<algorithm> 5 using namespace std; 6 int main() 7 { 8 int n; 9 while(scanf("%d",&n)&&n)10 {11 if(n%2==0)12 printf("8600\n");13 else14 printf("ailyanlu\n");15 }16 return 0;17 }
View code