Cod sursa(job #930546)

Utilizator tudy23Coder Coder tudy23 Data 27 martie 2013 18:25:25
Problema Jocul NIM Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.27 kb
#include <fstream>
using namespace std;
int main()
{
	ifstream f("nim.in");
	ofstream h("nim.out");
	int t;
	f>>t;
	int n,x;	
	for(int S=0;t;--t,S=0)
	{
		f>>n;
		for(;n;--n)
		{
			f>>x;
			S=S^x;
		}
		if(S)	h<<"DA";
		else	h<<"NU";
	}
	f.close();
	h.close();
	return 0;
}