Cod sursa(job #872299)
| Utilizator | Data | 5 februarie 2013 22:31:23 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.36 kb |
#include<fstream>
using namespace std;
ifstream in("nim.in");
ofstream out("nim.out");
int n,i,j,x,s,t;
int main()
{
in>>t;
for (i=1;i<=t;i++)
{
in>>n;
s=0;
for (j=1;j<=n;j++)
{
in>>x;
s^=x;
}
if (s) out<<"DA\n";
else out<<"NU\n";
}
}
