0101 - Aizu PR
#include <iostream> #include <string> #include <sstream> using namespace std; void Slove(string str_n) { string str; int int_n; stringstream ss; ss << str_n; ss >> int_n; for (int i=0; i<int_n; ++i) { getline(cin,str); while (str.find("Hoshino") != string::npos) str.replace(str.find("Hoshino"), 7, "Hoshina"); cout << str << endl; } } int main(void) { string str_n; getline(cin,str_n); Slove(str_n); return 0; }
連続Hoshinoを考えてませんでした...1WA