5-15 QQ帐户的申请与登陆 (25分)
2016-04-28 15:21
381 查看
#include "string" #include "iostream" #include "map" using namespace std; map<string,string> Q; int main( ) { // freopen("1.txt","r",stdin); int m; cin>>m; string a3,a2; char a1; while(m--) { cin>>a1>>a2>>a3; if(a1=='N') { if(Q.find(a2)==Q.end()) { Q[a2]=a3; cout<<"New: OK"<<endl; } else { cout<<"ERROR: Exist"<<endl; } } if(a1=='L') { if(Q.find(a2)==Q.end()) { cout<<"ERROR: Not Exist"<<endl; } else { map<string,string>::iterator it; it=Q.find(a2); if(it->second==a3) { cout<<"Login: OK"<<endl; } else { cout<<"ERROR: Wrong PW"<<endl; } } } } return 0; }
相关文章推荐
- 技术入股的坑
- Android onTouch事件解析
- 对象数组与指针+this指针
- 装饰者模式--Java篇
- NC开发笔记——1、主子表增加页签
- iPad登录网站,隐藏上传文档按钮
- RxJava学习(八)
- WebStorm2016.1 破解 激活
- SASS界面编译工具——Koala的使用
- Android http 请求——AsyncHttpClient集成【解决重定向问题、setEnableRedirects 方法异常、线程中调用异常问题】
- 九 循环
- docker 报Error: docker-engine-selinux conflicts with docker-selinux-1.9.1-25.el7.centos.x86_64
- equals函数的作用
- bootstrap的编辑标记 angularjs input 弹出框
- Python爬虫实战:极客学院
- 巴克莱银行如何利用R3区块链技术构建智能合约模板?
- 联合国会常务委员会明确破产法规:Arun Jaitley
- 16. 3Sum Closest
- zoj 1879
- JS实现字符处理