hdu acm1564Problem 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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/15 12:52:44
hduacm1564ProblemDescriptionNewYearisComing!ailyanluisveryhappytoday!andheisplayingachessboardgamewi

hdu acm1564Problem 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
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

hdu acm1564Problem 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
画图便可得到规律:
偶数时:8600胜
奇数时:ailyanlu胜
代码:
#include
int main()
{
int n;
while(scanf("%d",&n),n)
{
if(0==n%2)
puts("8600");
else
puts("ailyanlu");
}
return 0;
}