#include <map>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
string s, temp;
map<string, int> ma;
getline(cin, s);
for(int i = 0; i < s.length(); i++){
if(isalnum(s[i])) temp += tolower(s[i]);
else{
if(temp != "") ma[temp]++; temp = "";
}
if(i == s.length() - 1 && temp != "") ma[temp]++;
}
int max = 0;
string ans = "";
for(auto it:ma){
if(it.second > max){
ans = it.first; max = it.second;
}
}
cout << ans << " " << max << endl;
return 0;
}
1071 Speech Patterns
最新推荐文章于 2021-11-16 13:04:46 发布