Cod sursa(job #1401134)
Utilizator | Data | 25 martie 2015 17:54:13 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include<fstream>
using namespace std;
int T, n, x, y;
ifstream in("nim.in");
ofstream out("nim.out");
int main(){
in>>T;
while(T--){
in>>n;
in>>y;
for(n=n-1;n--;){
in>>x;
y^=x;
}
y==0?out<<"NU":out<<"DA";
}
return 0;
}