Cod sursa(job #757899)

Utilizator VictorPVictor Padureanu VictorP Data 13 iunie 2012 18:22:58
Problema Jocul NIM Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.31 kb
#include<stdio.h>

int main()
{
	int n;
	int x,t;
	int s=0;
	freopen("nim.in","r",stdin);
	freopen("nim.out","w",stdout);
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",n);
		s=0;
		while(n--)
		{
			scanf("%d",&x);
			s^=x;
		}
		if(s)
			printf("DA\n");
		else
			printf("NU\n");
	}
	return 0;
}