Cod sursa(job #129014)
Utilizator | Data | 28 ianuarie 2008 14:59:15 | |
---|---|---|---|
Problema | Fructe | Scor | 0 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <stdio.h>
#include <stdlib.h>
int main()
{
int nr,k=0,a=0,b=0,x;
FILE *i;
FILE *o;
i=fopen("fructe.in","r");
o=fopen("fructe.out","w");
fscanf(i,"%d\n",&nr);
for(k=1;k<=nr;k++)
{
fscanf(i,"%d%d",&a,&b);
if(b%2==1)
x=1;
else
x=0;
fprintf(o,"%d\n",x);
printf("%d",x);
}
fclose(i);
fclose(o);
system("PAUSE");
return 0;
}