Pagini recente » Cod sursa (job #2624301) | Cod sursa (job #1074364) | Cod sursa (job #824987) | Cod sursa (job #2434390) | Cod sursa (job #1076299)
#include <iostream>
#include<fstream>
using namespace std;
int h[1000001];
ifstream f("hashuri.in");
ofstream g("hashuri.out");
void op1(int x)
{
if(h[x]==0)
h[x]=1;
}
void op2(int x)
{
if(h[x]==1)
h[x]=0;
}
int op3(int x)
{
if(h[x]==1)
return 1;
}
int main()
{
int nr,i,x,op;
f>>nr;
for(i=1;i<=nr;i++)
{
f>>op>>x;
if(op==1)
op1(x);
else if(op==2)
op2(x);
else if(op==3)
g<<op3(x)<<endl;
}
return 0;
}