Pagini recente » Cod sursa (job #1994584) | Cod sursa (job #637620) | Cod sursa (job #836262) | Cod sursa (job #1763611) | Cod sursa (job #37583)
Cod sursa(job #37583)
program bowling;
type sir=array[1..50000]of boolean;
var n:longint;
t:byte;
jucator:shortint;
a:sir;
procedure afisare;
begin
if jucator=1 then
writeln('Fumeanu')
else writeln('Nargy')
end;
procedure prelucrare;
var i:integer;
begin
jucator:=1;
i:=1;
while i<=n do
if a[i] and a[i+1] then
begin
i:=i+2;
jucator:=jucator*-1;
end
else if a[i] and (not a[i+1]) then
begin
jucator:=jucator*-1;
i:=i+1;
end
else i:=i+1;
afisare;
end;
procedure citire;
var j:longint;
i,w:byte;
begin
assign(input,'bowling.in');
reset(input);
readln(t);
for i:=1 to t do
begin
read(n);
for j:=1 to n do
begin
read(w);
if w=1 then
a[j]:=true
else a[j]:=false;
end;
prelucrare;
end;
close(input);
end;
begin
assign(output,'bowling.out');
rewrite(output);
citire;
close(output);
end.