写这篇题解的目的是提醒一下^的优先级小于<
/* author:jxy lang:C/C++ university:China,Xidian University **If you need to reprint,please indicate the source** */ #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> using namespace std; int org[1001]; int main() { int n,ans=0; while(~scanf("%d",&n)&&n) { int i,out=0; ans=0; for(i=0;i<n;i++) { scanf("%d",&org[i]); ans^=org[i]; } for(i=0;i<n;i++) { if((ans^org[i])<org[i])out++; } printf("%d\n",out); } }