-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11.3.cpp
38 lines (37 loc) · 845 Bytes
/
11.3.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <unordered_map>
#include <string>
using namespace std;
int main(){
unordered_map<string,string> mymap;
string s1,s2;
char c;
int n;
cin>>n;
for(int i=0;i<n;i++){
if(i!=0) cout<<endl;
cin>>c;
cin>>s1;
cin>>s2;
if(c=='N'){
auto it=mymap.find(s1);
if(it==mymap.end()){
mymap[s1]=s2;
cout<<"New: OK";
}
else
cout<<"ERROR: Exist";
}
if(c=='L'){
auto it=mymap.find(s1);
if(it!=mymap.end())
if(it->second==s2)
cout<<"Login: OK";
else
cout<<"ERROR: Wrong PW";
else
cout<<"ERROR: Not Exist";
}
}
return 0;
}