题解:UVA10420 List of Conquests
Charles_with_wkc · · 题解
翻译:
给定你
思路:
这里我使用的是 STL 的 map。
map<string,int>mp;
代码:
cin>>n;
for(int i=1;i<=n;i++){
cin>>s;
mp[s]++;
getline(cin,s);
}
for(auto i:mp) cout<<i.first<<" "<<i.second<<endl;
//小知识:增强for循环->auto