Pagini recente » Cod sursa (job #2330198) | Cod sursa (job #2736195) | Cod sursa (job #1370051) | Cod sursa (job #2731697) | Cod sursa (job #229347)
Cod sursa(job #229347)
// bowlig.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
int main()
{
int t,a,b,i,j,d=0;
bool n[50004];
FILE *f1,*f2;
f1=fopen("bowling.in","r");
f2=fopen("bowling.out","w");
fscanf(f1,"%d",&t);
for(i=1;i<=t;i++)
{
fscanf(f1,"%d",&a);
for(j=1;j<=a+2;j++)
{
n[j]=0;
}
for(j=1;j<=a;j++)
{
fscanf(f1,"%d",&b);
n[j]=b;
}
for(j=1;j<=a;j++)
{
if(n[j]==1)
{
n[j]=0;
n[j+1]=0;
d++;
}
}
if(d%2==1) fprintf(f2,"Nargy\n");
else fprintf(f2,"Fumeanu\n");
}
fclose(f1);
fclose(f2);
return 0;
}