Cod sursa(job #1408741)

Utilizator mateidanutDanut Gabriel Matei mateidanut Data 30 martie 2015 11:07:43
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.35 kb
#include <fstream>
using namespace std;

int t, n, x, s;

ifstream f("nim.in");
ofstream g("nim.out");

int main()
{   f>>t;
    for (; t; --t)
    {   f>>n;
        s=0;
        for (; n; --n)
        {   f>>x;
            s=s^x;
        }
        if (s)
            g<<"DA\n";
        else
            g<<"NU\n";
    }
    return 0;
}