Skip to content

Instantly share code, notes, and snippets.

@happasuke
Created April 29, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happasuke/4302b28b8acf33b1c8050e393d4cfbdd to your computer and use it in GitHub Desktop.
Save happasuke/4302b28b8acf33b1c8050e393d4cfbdd to your computer and use it in GitHub Desktop.
#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