Cod sursa(job #2678121)
| Utilizator | Data | 28 noiembrie 2020 10:38:21 | |
|---|---|---|---|
| Problema | Jocul NIM | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.28 kb |
#include <fstream>
std::ifstream f("nim.in");
std::ofstream g("nim.out");
int main()
{
int n, x, y;
f >> n;
while (n--)
{
f >> x;
int a = 0;
while (x--)
{
f >> y;
a ^= y;
}
if (a == 0)
g << "DA" << '\n';
else g << "NU" << '\n';
}
}
