Pagini recente » Cod sursa (job #2339767) | Cod sursa (job #2806785) | Cod sursa (job #601588) | Cod sursa (job #2162359) | 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;
}