取石子,持续更新……

一.

有n堆石子堆,每堆有一定数量的石子,A,B两人轮流在任意堆石子堆中取任意个石子,A先手,先拿完者取胜,问A是否能取胜。

http://poj.org/problem?id=2234

POJ2234
 1 #include<stdio.h>
 2 
 3 int n;
 4 
 5 int main()
 6 {
 7     while(scanf("%d", &n) != EOF)
 8     {
 9         int ans = 0;
10         for(int i = 1; i <= n; i ++)
11         {
12             int x;
13             scanf("%d", &x);
14             ans ^= x;
15         }
16         if(ans == 0)
17             printf("No
");
18         else
19             printf("Yes
");
20     }
21     return 0;
22 }

原文地址:https://www.cnblogs.com/yuanweidao/p/11243468.html