Cod sursa(job #956767)
Utilizator | Data | 3 iunie 2013 20:41:34 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <fstream>
using namespace std;
ifstream f("nim.in");
ofstream g("nim.out");
int t,n;
void read()
{
int S=0,val;
int i;
f>>t;
while(t--)
{
f>>n;
S=0;
while(n--)
{
f>>val;
S^=val;
}
if(S==0)
g<<"NU\n";
else
g<<"DA\n";
}
}
int main()
{
read();
return 0;
}