Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#include <iostream>
#include <string>
using namespace std;
int main(){
int n;
int p;
string s;
cin >> n;
cin.ignore();
for (int i = 0; i < n; i++){
getline(cin, s);
do{
p = s.find("Hoshino");
if (p != -1){
s.replace(p,7,"Hoshina");
}
else{
break;
}
} while (p-7 >= s.length());
cout << s << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment