Pagini recente » Cod sursa (job #1905074) | Cod sursa (job #1060831) | Cod sursa (job #1240083) | Cod sursa (job #1708222) | Cod sursa (job #40828)
Cod sursa(job #40828)
//BMC
#include<fstream.h>
#define M 100050
ifstream fin("bowling.in");
ofstream fout("bowling.out");
int main()
{ char c[M];
int cont1,cont2=0,i,l,j,t,n=0;
fin>>t;
for(i=1;i<=t;i++)
{ fin.getline(c,M-1);
j=0;
l=strlen(c);
cont1=0;
while(c[j]!=' '){n=n*10+c[j]-'0';j++;}
for(j+=1;j<l;j+=2)
{ if(c[j]=='1')cont1++;
if(c[j]=='0')
{ if(cont1&1)
cont2=!cont2;
cont1=0;
}
}
if(cont2)fout<<"Fumeanu\n";
else fout<<"Nargy\n";
}
return 0;}