不知道为什么错误
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#define MaxSize 1005
using namespace std;
int main(){
string s, s2;
string::size_type loc, pos;
s2 = "OH-OH-OH-QQ-PEI-PEI-SHION";
while(getline(cin, s)){
loc = 0;
pos = 0;
while(loc != string::npos && loc < s.size()){
loc = s.find("occupation", pos);
if(loc != string::npos){
//替换操作
//This is the occupation american occupation.
s = s.substr(0, loc) + s2 + s.substr(loc + 10, s.length());
pos = loc + 25;
}
}
cout << s << endl;
}
return 0;
}