2013
12-12

# Play a game

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?

The 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.

Output the winner ("8600" or "ailyanlu") for each input line except the last zero.
No other characters should be inserted in the output.

2
0

8600

http://acm.hdu.edu.cn/showproblem.php?pid=1564

//============================================================================
// Name        : hdu.cpp
// Author      : lanjiangzhou
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<cstdio>

using namespace std;

int main() {
int n;
while(scanf("%d",&n)!=EOF){
if(n==0) break;
if(n%2==0) printf("8600\n");
else printf("ailyanlu\n");
}
return 0;
}

1. 算法是程序的灵魂，算法分简单和复杂，如果不搞大数据类，程序员了解一下简单点的算法也是可以的，但是会算法的一定要会编程才行，程序员不一定要会算法，利于自己项目需要的可以简单了解。

2. 这道题目的核心一句话是：取还是不取。
如果当前取，则index+1作为参数。如果当前不取，则任用index作为参数。