Cod sursa(job #2215006)
Utilizator | Data | 20 iunie 2018 18:26:44 | |
---|---|---|---|
Problema | Jocul NIM | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.46 kb |
#include <fstream>
using namespace std;
ifstream cin("nim.in");
ofstream cout("nim.out");
int main()
{
int t, n;
cin >> t;
for (int i = 0; i < t; ++i) {
cin >> n;
int val, xur(0);
for (int j = 0; j < n; ++j) {
cin >> val;
xur ^= val;
}
if (xur) {
cout << "DA\n";
}
else {
cout << "NU\n";
}
}
return 0;
}