Cod sursa(job #655364)

Utilizator titeltitel popescu titel Data 2 ianuarie 2012 13:24:14
Problema Jocul NIM Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.24 kb
#include<fstream>
using namespace std;
ifstream f("nim.in"); ofstream g("nim.out");
int main()
{int n,t,s,x;
 f>>t;
 while(t--)
	{f>>n; s=0;
	 while(n--) {f>>x; s=s^x;}
	 if(s) g<<"DA\n"; else g<<"NU\n";
	}
 g.close(); return 0;
}