Cod sursa(job #1367727)
Utilizator | Data | 2 martie 2015 02:08:15 | |
---|---|---|---|
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 main()
{
int t;
in >> t;
while (t--)
{
int n;
in >> n;
int s = 0;
while (n--)
{
int x;
in >> x;
s ^= x;
}
if (!s) out << "NU\n";
else out << "DA\n";
}
}