提交有错误,不知道哪里有问题,请大家帮我分析一下
Codeup新家 http://codeup.hustoj.com/problem.php?cid=100000599&pid=0
#include <iostream>
#include <map>
#include <string>
#include <ctype.h>
using namespace std;
int main()
{
string str;
string::iterator it,tempit;
map<string,int> mp;
map<string,int>::iterator mpit;
while(1){
cin>>str;
for(it=str.begin();it!=str.end();it++){
if(!isalnum(*it)){
tempit=it;
it--;
str.erase(tempit);
}else *it=tolower(*it);
}
if(mp.find(str)!=mp.end()) mp[str]++;
else mp[str]=1;
if(cin.get()=='\n') break;
}
int maxn=0;
string word;
for(mpit=mp.begin();mpit!=mp.end();mpit++){
if(mpit->second>maxn){
maxn=mpit->second;
word=mpit->first;
}
}
cout<<word<<" "<<maxn<<endl;
return 0;
}
能具体说说是哪方面的错误啊,有什么错误提示啊