Cod sursa(job #612323)

Utilizator johnyJohny Deep johny Data 6 septembrie 2011 20:34:21
Problema Jocul NIM Scor 0
Compilator fpc Status done
Runda Arhiva educationala Marime 0.34 kb
program Nim;
var t,n,x,S:longint;
    i,j:longint;

begin
  assign(input,'nim.in');
  reset(input);
  readln(t);
  for i:=1 to t do
  begin
    readln(n);
    S:=0;
    for j:=1 to n do
    begin
      read(x);
      S:=S xor x;
    end;
    if S>0 then writeln('DA')
    else writeln('NU');
    readln;
  end;
  close(input);
end.