Cod sursa(job #1538523)

Utilizator ili226Vlad Ilie ili226 Data 29 noiembrie 2015 11:51:07
Problema Jocul NIM Scor 80
Compilator fpc Status done
Runda Arhiva educationala Marime 0.39 kb
var f,fo:text;
      i,t:byte;
      j,n:word;
      s,x:longint;
begin
assign(f,'nim.in');
assign(fo,'nim.out');
reset(f);
rewrite(fo);
readln(f,t);
for i:=1 to t do
 begin 
  readln(f,n);s:=0;
  for j:=1 to n do
   begin
    read(f,x);
    s:=s xor x;
   end;
  if s=0 then writeln(fo,'NU')   
            else writeln(fo,'DA');	 	
  readln(f);
 end;
close(fo);
close(f);
end.