Cod sursa(job #1910350)
| Utilizator | Data | 7 martie 2017 16:32:15 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <cstdio>
using namespace std;
int x,n,numere;
void read()
{
freopen("nim.in","r",stdin);
freopen("nim.out","w",stdout);
scanf("%d",&x);
for(int i = 0 ; i < x ; i++)
{
scanf("%d", &n);
numere = 0;
for(int j = 0 ; j < n ; j++)
{
int y ;
scanf("%d",&y);
numere^=y;
}
if(numere == 0)
printf("NU\n");
else
printf("DA\n");
}
}
int main()
{
read();
return 0;
}
