可以用map
map<key, value>
map[key] = value;
map.count();
#include<iostream>
#include<map>
using namespace std;
map<string, string> mp;
int main() {
int n;
cin >> n;
while(n --) {
char c;
string zh, mm;
cin >> c >> zh >> mm;
if(c == 'L') {
if(!mp.count(zh)) puts("ERROR: Not Exist");
else if(mp[zh]==mm) puts("Login: OK");
else puts("ERROR: Wrong PW");
} else {
if(mp.count(zh)) puts("ERROR: Exist");
else {
mp[zh] = mm;
puts("New: OK");
}
}
}
return 0;
}