Cod sursa(job #2245963)

Utilizator 53215343214Nejneriu Mihai 53215343214 Data 26 septembrie 2018 11:59:14
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.38 kb
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ifstream f("nim.in");
    ofstream g("nim.out");
    int t,i,j,n,x,s=0;
    f>>t;
    for (i=1;i<=t;i++)
    {
        s=0;
        f>>n;
        for (j=1;j<=n;j++)
        {
            f>>x;
            s=s^x;
        }
        if (s) g<<"DA"<<'\n';
        else
            g<<"NU"<<'\n';
    }
}