求帮助

· · 算法·理论

#include<bits/stdc++.h>
#include<map>
using namespace std;
map<string,int> m;
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        string s;
        int x;
        cin>>s>>x;
        m[s]=x;
    }
    for(map<string,int>::iterator it=m.begin();it!=m.end();it++){
           cout<<it.first<<' '<<it.second<<'\n'; 
    }
    return 0;
}

特别鸣谢woaiwo大佬