Cod sursa(job #45494)

Utilizator el_marius77Marius Necula el_marius77 Data 1 aprilie 2007 16:23:43
Problema Bowling Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.6 kb
var f,g:text;
    t:byte;
    n,i,j,necastig,nunu,x:word;
begin
  assign(f,'bowling.in');
  assign(g,'bowling.out');
  rewrite(g);
  reset(f);
  read(f,t);
  for i:=1 to t do begin
    read(f,n);

    necastig:=0;
    nunu:=0;
    for j:=1 to n do begin
      read(f,x);
      if x=1 then inc(nunu)
      else begin
        if (nunu mod 3=0) and (nunu<>0) then inc(necastig);
        nunu:=0;
      end;
    end;
    if necastig=0 then writeln(g,'Nargy')
    else
      if necastig mod 2 = 0 then writeln(g,'Narghy')
        else writeln(g,'Fumeanu');

  end;
  close(g);
  close(f);
end.