Pagini recente » Cod sursa (job #3199474) | Cod sursa (job #1758075) | Cod sursa (job #2768183) | Cod sursa (job #112645) | Cod sursa (job #607908)
Cod sursa(job #607908)
#include <stdio.h>
#define DIM 1000000
int x,y,N,i;
int a[DIM];
int main(){
FILE *f = fopen("hashuri.in","r");
FILE *g = fopen("hashuri.out","w");
fscanf(f,"%d",&N);
for (i=1;i<=N;i++)
{
fscanf(f,"%d" "%d",&y,&x);
if (y==1) a[x]=1;
else
if (y==2) a[x]=0;
else
if (y==3){
if (a[x]==1) fprintf(g,"%d\n",1);
else
fprintf(g,"%d\n",0);
}
}
fclose(f);
fclose(g);
return 0;
}