Cod sursa(job #2412178)

Utilizator bilghinIsleam Bilghin bilghin Data 21 aprilie 2019 18:56:12
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.43 kb
#include <iostream>
#include <fstream>

using namespace std;

ifstream si("nim.in");
ofstream so("nim.out");

int main()
{
    int n,t,i,s,x;

    si>>t;
    for(int j=0;j<t;j++){
        si>>n;
        s=0;
        for(i=0;i<n;i++){
            si>>x;
            s=s^x;
        }
        if(s!=0){
            so<<"DA"<<"\n";
        }
        else{
            so<<"NU"<<"\n";
        }
    }

    return 0;
}