#include <iostream>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
int main ()
{
string str;
vector<string> svec;
while (cin>>str)
svec.push_back(str);
cin.clear();
int *pi=new int[svec.size()];
memset(pi,0,svec.size());
for(vector<string>::iterator iter0=svec.begin();iter0!=svec.end();++iter0)
for(vector<string>::iterator iter=iter0;iter!=svec.end();++iter)
if(*iter==*iter0)
++*(pi+iter-svec.begin());
int max=*pi;
size_t maxi=0;
for (size_t i=1;i!=svec.size();++i)
if (*(pi+i)>max)
{
max=*(pi+i);
maxi=i;
}
cout<<"预处理对象为:"<<endl;
for (vector<string>::iterator iter=svec.begin();iter!=svec.end();++iter)
cout<<*iter<<' ';
cout<<endl;
if(1==max)
cout<<"单词无重复"<<endl;
else
cout<<"单词"<<*(svec.begin()+i)<<"出现了"<<*(pi+i)<<"次"<<endl;
delete [] pi;
return 0;
}
第19行为什么出现error C2110: cannot add two pointers