解题思路:
map的运用。
注意事项:
参考代码:
#include <bits/stdc++.h> using namespace std; map<string,int>mp; int main(){ int n,max=0; //freopen("f:/123.txt","r",stdin); string str; cin>>n; while(getline(cin,str)){ mp[str]++; if(max<mp[str]) max=mp[str]; } map<string,int>::iterator it; for(it=mp.begin();it!=mp.end();it++){ if(it->second==max) cout<<it->first<<endl; } return 0; }
0.0分
0 人评分