#include <map>
#include <iostream>
using namespace std
;
map
<string
,int>mp
;
bool check(char c
)
{
if(c
>='0'&&c
<='9')
return true;
else if(c
>='A'&&c
<='Z')
return true;
else if(c
>='a'&&c
<='z')
return true;
return false;
}
int main()
{
string str
;
getline(cin
,str
);
int i
=0;
while(i
<str
.length())
{
string word
;
while(i
<str
.length()&&check(str
[i
])==true)
{
if(str
[i
]>='A'&&str
[i
]<='Z')
str
[i
]+=32;
word
+=str
[i
];
i
++;
}
if(word
!="")
{
if(mp
.find(word
)==mp
.end())
mp
[word
]=1;
else
mp
[word
]++;
}
while(i
<str
.length()&&check(str
[i
])==false)
i
++;
}
string ans
;
int MAX
=0;
for(map
<string
,int>::iterator it
=mp
.begin();it
!=mp
.end();it
++)
{
if(it
->second
>MAX
)
{
MAX
=it
->second
;
ans
=it
->first
;
}
}
cout
<<ans
<<" "<<MAX
<<endl
;
return 0;
}
转载请注明原文地址: https://mac.8miu.com/read-511056.html