Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	n, _ := strconv.Atoi(stdin.Text())

	for i := 0; i < n; i++ {
		stdin.Scan()
		fmt.Println(strings.Replace(stdin.Text(), "Hoshino", "Hoshina", -1))
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main(){

  int n, idx;
  string s;

  cin >> n;

  for(int i = n; i >= 0; --i){

    getline(cin, s);

    while((idx = s.find("Hoshino", 0)) != string::npos){

      s[idx + 6] = 'a';

    }

    cout << s << endl;

  }

}

C++: #include <bits/stdc++.h>

using namespace std;
 
int main()
{
    string str;
    int n;
     
    cin >> n;
    cin.ignore();
    while (n--) {
        getline(cin, str);
        for (int j = 0; j < (int)str.size()-7; j++) {
            string key = str.substr(j, 7), repl;
            if (key == "Hoshino") {
                repl = "Hoshina";
                for (int k = 0; k < n; k++) {
                    str[j+k] = repl[k];
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  getline(cin, s);
  for (int i = 0; i < n; i++) {
    getline(cin, s);
    for (int i = 6; i < s.length(); i++)
      if (s[i-6] == 'H' &&
          s[i-5] == 'o' &&
          s[i-4] == 's' &&
          s[i-3] == 'h' &&
          s[i-2] == 'i' &&
          s[i-1] == 'n' &&
          s[i] == 'o')
        s[i] = 'a';
    cout << s << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>


int n;
std::string str;


std::string substg(int a, int b) {
	std::string res = "";
	for (int i = a; i < a + b; i++) {
		res += str[i];
	}

	return res;
}

void replace(int a) {
	std::string hoge = "Hoshina";

	for (int i = a; i < a + 7; i++) {
		str[i] = hoge[i - a];
	}
}

void solve() {
	int i = 0;
	while (i <= (signed)(str.size() - 7)) {
		if (substg(i, 7) == "Hoshino") {
			replace(i);
			i += 7;

			continue;
		}

		i++;
	}

	std::cout << str << std::endl;
}




int main() {
	std::cin >> n;

	std::cin.ignore();

	for (; n > 0; n--) {
		std::getline(std::cin, str);

		solve();
	}

	return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;c=getchar();
	for(j=0;j<n;j++){
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c=='\n'){
	   break;
	  }else{
	   switch(flg){
		case 0:
		if(c=='H'){flg++;}
		break;
		case 1:
		if(c=='o'){flg++;}else{flg=0;}
		break;
		case 2:
		if(c=='s'){flg++;}else{flg=0;}
		break;
		case 3:
		if(c=='h'){flg++;}else{flg=0;}
		break;
		case 4:
		if(c=='i'){flg++;}else{flg=0;}
		break;
		case 5:
		if(c=='n'){flg++;}else{flg=0;}
		break;
		case 6:
		if(c=='o'){c='a';}
		flg=0;
		break;
	   }
	   cout<<c;
	  }
	 }
	 cout<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
#include <string.h>

int main()
{
	int n;
	char str[1000];

	scanf("%d", &n);
	for (int i = 0; i < n+1; i++) {
		fgets(str, 80, stdin);

		if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
		printf("%s\n", str);
	}

	return 0;
}

C++: #include<iostream>
#include<cstring>
using namespace std;
int main(){
	int n;
	char s[1050],ha[]="Hoshina",ho[]="Hoshino";
	cin>>n;
	while(n-->0){
		fgets(s,1050,stdin);
		for(int i=0;i<strlen(s);i++){
			if(i==0){
				if(!strncmp(&s[i],ho,7)&&(s[i+7]==' '||s[i+7]=='\n'||s[i+7]=='\0')){
					strncpy(&s[i],ha,7);
				}
			}
			else{
				if(!strncmp(&s[i],ho,7)&&(s[i+7]==' '||s[i+7]=='\n'||s[i+7]=='\0')&&s[i-1]==' '){
					strncpy(&s[i],ha,7);
				}
			}
		}
		cout<<s;
	}
	return 0;
}

C++: //#include <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
	for(int j = 0; j<= n; j++)
	{
	
		char s[MAX_SIZE] = {};
		gets(s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hoshina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}
		if(j != 0) cout << endl;
	}
	return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main() {
	int n;

	cin >> n;
	getchar();
	for (int i = 0; i < n; i++) {
		char str[1001];
		gets(str);
		for (int j = 0, len = strlen(str); j < len - 6; j++) {
			if (strncmp(&str[j], "Hoshino", strlen("Hoshino")) == 0) {
				strncpy(&str[j], "Hoshina", strlen("Hoshina"));
			}
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>

using namespace std;

string str;
string hoshino = "Hoshino";
int hlen = hoshino.length();

void changeHoshino(int len) {
	for (int i = 0; i <= len - hlen; i++) {
		int j = 0;
		while ((j < hlen) && (str[i+j] == hoshino[j]))
			j++;

		if (j == hlen)
			str[i+j-1] = 'a';
	}
}

int main() {
	int n;
	
	scanf("%d", &n);
	
	for (int i = 0; i < n; i++) {
		getline(cin, str);

		changeHoshino(str.length());

		cout << str << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <string>



int main(){
	std::string str;
	int data_num;
	std::cin >> data_num;
	std::cin.ignore();
	for(int i = 0; i < data_num; ++i){
		u_int loc = 0;
		u_int size;
		getline(std::cin, str);
		size = str.size();
		while(1){
			loc = str.find("Hoshino", loc);
			if(loc == std::string::npos || loc == size){
				break;
			}
			str[loc+6] = 'a';
			++loc;	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>

int main(){
    int n;
    std::string str;
    std::string fr = "Hoshino";
    std::string to = "Hoshina";
    std::string::size_type pos;
    std::cin >> n;
    std::cin.get();
    
  
        //文字列の読み込み
        while(n > 0 && std::getline(std::cin, str)){
            //"Hoshino"を"Hoshina"に変換
            pos = str.find(fr);
            while(pos != std::string::npos){
                str.replace(pos, fr.size(), to);
                pos = str.find(fr, pos+to.size());
            }
             std::cout << str << std::endl;
            str = "";
            std::cin.clear();
            --n;
        }
}

C++: #include<iostream>
#include<string>
using namespace std;

int main() {
	int n;
	cin >> n;
	for (int i = 0;i < n;i++) {
		string s;
		getline(cin, s);
		int a = s.size();

		for (int j = 0;j < a - 6;j++) {
			string sb;
			sb = s.substr(j, 7);
			if (sb == "Hoshino") {
				s.replace(j, 7, "Hoshina");
			}
		}
		cout << s << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(itr,c) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

vector<string> split(string& s, char x){
  int i;
  vector<string> res(1);

  int word = 0;
  rep(i,s.size()){
    if(s[i] != x) res[word].push_back(s[i]);
    else if(i != 0 && i != s.size()-1){
      word++;
      res.push_back("");
    }
  }

  return res;
}

int main(){
  int i,j,N;

  scanf("%d\n",&N);
  rep(i,N){
    string in;
    getline(cin,in);

    vector<string> sp = split(in,' ');
    rep(j,sp.size()){
      if(sp[j] == "Hoshino") sp[j] = "Hoshina";
      cout << sp[j];
      if(j != sp.size()-1) cout << ' '; else cout << endl;
    }
  }

  return 0;
}