Cod sursa(job #2291236)

Utilizator Raresr14Rosca Rares Raresr14 Data 27 noiembrie 2018 19:47:04
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.37 kb
#include <fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int t,n,sol,i,x;
int main(){
    fin>>t;
    for(;t--;){
        fin>>n;
        sol=0;
        for(i=1;i<=n;i++){
            fin>>x;
            sol^=x;
        }
        if(sol==0)
            fout<<"NU\n";
        else
            fout<<"DA\n";
    }
    return 0;
}