Cod sursa(job #781717)

Utilizator andrei_toaderToader Andrei Sorin andrei_toader Data 24 august 2012 22:40:01
Problema Jocul NIM Scor 70
Compilator fpc Status done
Runda Arhiva educationala Marime 0.43 kb
program joucl_nim;
var f,g:text;
    t,j:byte;
    n,i:integer;
    s:longint;
    nr:longint;


begin
 assign (f,'nim.in'); reset (f);
 assign (g,'nim.out'); rewrite (g);
 readln (f,t);
 for j:=1 to t do
 begin
  readln (f,n);
  s:=0;
  for i:=1 to n do
  begin
   read (f,nr);
   s:=s xor nr;
  end;
  readln (f);
  if s<>0 then
   writeln (G,'DA')
  else
   writelN (g,'NU');
 end;
 close (f); close (G);
end.