![](https://img-blog.csdnimg.cn/20200315214552702.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MTY4ODA3Ng==,size_16,color_FFFFFF,t_70)
#include <iostream>
#include <cstring>
#include<map>
#include<cmath>
using namespace std;
map<string,int>mp;
bool check(char ch){
if(isalpha(ch)) return true;
if(ch>='0'&&ch<='9')return true;
return false;
}
int main() {
string ss;
string word;
getline(cin,ss);
for(int i=0;i<ss.length();i++){
if(check(ss[i])){
if(isupper(ss[i]))
ss[i]+=32;
word+=ss[i];
}
if(i==ss.length()-1||check(ss[i])==0)
{
if(word.length()!=0){
mp[word]++;
}
word.clear();
}
}
int mx=-1;
string ans;
map<string,int>::iterator it;
for(it=mp.begin();it!=mp.end();it++)
{
if(it->second>mx){
mx=it->second;
ans=it->first;
}
}
cout<<ans<<" "<<mx;
return 0;
}
```cpp
在这里插入代码片