Pagini recente » Cod sursa (job #1255807) | Cod sursa (job #2913166) | Cod sursa (job #2556990) | Cod sursa (job #2262938) | Cod sursa (job #1191650)
#include <fstream>
#include <cstring>
#include <tr1/unordered_map>
#define Nmax 15
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
tr1::unordered_map<string,int>lista;
int main()
{int t,op;
char val[Nmax];
f>>t;f.get();
while (t)
{f>>op;
f.getline(val,Nmax);
if (op==1)
lista[val]=1;
if (op==2)
lista.erase(val);
if (op==3)
g<<lista[val]<<'\n';
t--;
}
return 0;
}