输入样例:
5
L 1234567890 myQQ@qq.com
N 1234567890 myQQ@qq.com
N 1234567890 myQQ@qq.com
L 1234567890 myQQ@qq
L 1234567890 myQQ@qq.com
输出样例:
ERROR: Not Exist
New: OK
ERROR: Exist
ERROR: Wrong PW
Login: OK
代码:
#include<iostream>
#include<map>
using namespace std;
map<long long,int>cz;
map<long long,string>mp;
int main(){int n; cin>>n;for(int i=0;i<n;i++){char op;long long x;string y;getchar();scanf("%c %lld",&op,&x); cin>>y;int d=y.length();if(op=='L'){if(!cz[x]) printf("ERROR: Not Exist\n");else if(mp[x]==y) printf("Login: OK\n");else printf("ERROR: Wrong PW\n");}else{if(cz[x]) printf("ERROR: Exist\n");else if(x>1000&&d>=6&&d<=16){printf("New: OK\n");cz[x]=1; mp[x]=y;}}}return 0;
}