Cod sursa(job #1224345)
Utilizator | Data | 30 august 2014 17:18:24 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include <fstream>
using namespace std;
ifstream f("nim.in");
ofstream g("nim.out");
int n,x,p,y,i;
int main()
{
for(f>>p;p;p--)
{
f>>n;
for(x=i=0;i<n;i++)
f>>y,x^=y;
g<<(x ? "DA" : "NU")<<'\n';
}
return 0;
}