作业帮 > 英语 > 作业

hdu acm1564

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/24 23:41:23
hdu acm1564
Problem Description
New 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?
Input
The input is a sequence of positive integers each in a separate line.
The integers are between 1 and 10000,inclusive,(means 1
画图便可得到规律:
偶数时:8600胜
奇数时:ailyanlu胜
代码:
#include
int main()
{
int n;
while(scanf("%d",&n),n)
{
if(0==n%2)
puts("8600");
else
puts("ailyanlu");
}
return 0;
}