Pagini recente » Cod sursa (job #3121790) | Borderou de evaluare (job #996821) | Cod sursa (job #2296535) | Rating Andrei Madalin (KaLoo1992) | Cod sursa (job #408368)
Cod sursa(job #408368)
#include<vector>
#include<fstream>
using namespace std;
int main()
{
vector <int> v(10000000);
int op,n,i,x;;
FILE *f,*g;
f=fopen("hashuri.in","r");
g=fopen("hashuri.out","w");
fscanf(f,"%d",&n);
for(i=0;i<n;i++)
{
fscanf(f,"%d%d",&op,&x);
if(op==1)
v[x]=1;
else
if(op==2)
v[x]=0;
else
if(op==3)
if(v[x]==1)
fprintf(g,"1 \n");
else
fprintf(g,"0 \n");
}
fclose(f);
fclose(g);
}