求大佬回复!必关!!
#include<bits/stdc++.h>
using namespace std;
map<string, int> mp;
string s;
int n, op, scr, len;
int main() {
cin >> n;
while (n--) {
cin >> op;
if (op == 1) {
cin >> s >> scr;
mp[s] = scr;
cout << "OK" << endl;
len++;
} else if (op == 2) {
cin >> s;
if (mp[s] != 0) {
cout << mp[s] << endl;
} else {
cout << "Not found" << endl;
}
} else if (op == 3) {
cin >> s;
if (mp.find(s)!=mp.end()) {
mp[s] = 0;
cout << "Deleted successfully" << endl;
len--;
} else {
cout << "Not found" << endl;
}
} else {
cout << max(len, 0) << endl;
}
}
return 0;
}