title: 题目[Being a Good Boy in Spring Festival](https://vjudge.csgrandeur.cn/problem/HDU-1850)下面是一个二人小游戏:桌子上有M堆扑克牌;每堆牌的数量分别为Ni(i=1…M);两人轮流进行;每走一步可以任意选择一堆并取走其中的任意张牌;桌子上的扑克全部取光,则游戏结束;最后一次取牌的人为胜者。现在我们不想研究到底先手为胜还是为负,我只想问大家:――“先手的人如果想赢,第一步有几种选择呢?”
title:代码~~~ c ++#include <iostream>using namespace std;int main(){ while (cin >> n && n) { int res = 0, a[110], cnt = 0; for (int i = 0; i < n; i++) res ^= a[i] = readInt(); if (res == 0) cout << "0\n"; else { for (int i = 0; i < n; i++) { int k = res ^ a[i]; if (k < a[i]) cnt++; } cout << cnt << endl; } } return 0;}~~~