Cod sursa(job #1810096)

Utilizator robx12lnLinca Robert robx12ln Data 19 noiembrie 2016 16:35:29
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.42 kb
#include<fstream>
using namespace std;
ifstream fin("nim.in");
ofstream fout("nim.out");
int sol, x, n, t;
int main(){
    for( fin >> t; t != 0; t-- ){
        fin >> n;
        sol = 0;
        for( int i = 1; i <= n; i++ ){
            fin >> x;
            sol ^= x;
        }
        if( sol > 0 ){
            fout << "DA\n";
        }else{
            fout << "NU\n";
        }
    }
    return 0;
}