Cod sursa(job #1991015)

Utilizator Moise_AndreiMoise Andrei Moise_Andrei Data 14 iunie 2017 17:20:11
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.46 kb
#include <iostream>
#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 res = 0, x;
        for(int i = 1; i <= n; i++)
        {
            in >> x;
            res ^= x;
        }
        if(!res)
            out << "NU" << '\n';
        else
            out << "DA" << '\n';
    }
    return 0;
}