链接:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<map>
using namespace std;
int main()
{
int n;
char ch;
string str1,str2;
map<string,string>mapp;
map<string,string>::iterator ii;
scanf("%d",&n);
for(int i=1; i<=n; i++)
{
cin>>ch>>str1>>str2;
ii=mapp.find(str1);
if(ch=='N')
{
if(ii==mapp.end())
{
cout<<"New: OK"<<endl;
mapp[str1]=str2;
}
else
cout<<"ERROR: Exist"<<endl;
}
else if(ch=='L')
{
if(ii==mapp.end())
cout<<"ERROR: Not Exist"<<endl;
else if(ii->first.compare(str1)==0)
{
if(ii->second.compare(str2)==0)
cout<<"Login: OK"<<endl;
else
cout<<"ERROR: Wrong PW"<<endl;
}
}
}
return 0;
}