PAT QQ帐户的申请与登陆 STL-MAP的应用
2015-05-12 14:34
525 查看
链接:
QQ帐户的申请与登陆
QQ帐户的申请与登陆
#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; }
相关文章推荐
- PAT QQ帐户的申请与登陆(25)(map的应用)
- 5-05. QQ帐户的申请与登陆(25)(map运用)(ZJU_PAT)
- 5-05. QQ帐户的申请与登陆(25)(map运用)(ZJU_PAT)
- PAT 5-60 QQ帐户的申请与登陆 <再一次map与set速度对比>
- 浙江大学PAT上机题解析之5-05. QQ帐户的申请与登陆
- 5-05. QQ帐户的申请与登陆STL
- 5-05. QQ帐户的申请与登陆STL
- 浙大PAT 5-05. QQ帐户的申请与登陆 (解题思路)
- 浙江大学PAT上机题解析之5-05. QQ帐户的申请与登陆
- PTA 7-15 QQ帐户的申请与登陆(25 分)map简单结合方法
- PAT 数据结构 09-散列2. QQ帐户的申请与登陆(25)
- 09-2. QQ帐户的申请与登陆
- 11-散列3 QQ帐户的申请与登陆 (25分)
- 5-15 QQ帐户的申请与登陆 (25分)
- 5-15 QQ帐户的申请与登陆 (25分)
- QQ帐户的申请与登陆
- 中国大学MOOC-数据结构基础习题集、09-2、QQ帐户的申请与登陆
- 散列3 QQ帐户的申请与登陆
- 5-05. QQ帐户的申请与登陆(25)
- PAT5-05. QQ帐户的申请与登陆