Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var n int
	fmt.Scanf("%d", &n)

	result := make([]string, n, n)

	for i := 0; i < n; i++ {
		scanner.Scan()
		input := scanner.Text()

		result[i] = strings.Replace(input, "Hoshino", "Hoshina", -1)
	}

	for _, v := range result {
		fmt.Println(v)
	}
}

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

using namespace std;

int main(){

	int n;
	cin>>n;
	string str;
	getline(cin,str);
	for(int m = 0; m < n; m++){
		getline(cin,str);
		string nstr;
		int prvIdx=0;
		bool start=false;
		for(int i = 0; i < str.size(); i++){
			if(i+6<str.size()&&str.substr(i,7)=="Hoshino"){
				nstr+="Hoshina";
				i+=6;
			}
			else{
				nstr+=str[i];
			}
			//if(i==str.size()-1){
			//	if(!start){
			//		nstr+=str[i];
			//	}
			//	else{
			//		string ss=str.substr(prvIdx,i-prvIdx+1);
			//		if(ss=="Hoshino"){
			//			nstr+="Hoshina";
			//		}
			//		else
			//			nstr+=ss;
			//	}
			//}
			//else if(((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z'))){
			//	if(!start){
			//		start=true;
			//		prvIdx=i;
			//	}
			//}
			//else{
			//	if(start){
			//		string ss=str.substr(prvIdx,i-prvIdx);
			//		if(ss=="Hoshino"){
			//			nstr+="Hoshina";
			//		}
			//		else{
			//			nstr+=ss;
			//		}
			//		start=false;
			//	}
			//	nstr+=str[i];
			//}

			//if(i==str.size()-1){
			//	string ss=str.substr(prvIdx,str.size()-prvIdx);
			//	if(ss=="Hoshino"){
			//		nstr+="Hoshina";
			//	}
			//	else
			//		nstr+=ss;
			//}
			//else if(!((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z'))){
			//	string ss=str.substr(prvIdx,i-prvIdx);
			//	if(ss=="Hoshino"){
			//		nstr+="Hoshina";
			//	}
			//	else
			//		nstr+=ss;
			//	nstr+=str[i];
			//	prvIdx=i+1;
			//}
		}
		cout<<nstr<<endl;
	}

	return 0;
}

C++: #include <sstream>
#include <iostream>
#include <array>

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, '\t')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += ('\t' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;
string S;
int main() {
	while (getline(cin, S)) {
		if (S.size() >= 7) {
			for (int i = 0; i < S.size() - 6; i++) {
				if (S.substr(i, 7) == "Hoshino") {
					S[i + 6] = 'a';
				}
			}
		}
		cout << S << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main()
{
	int n, coll, i, j;
	ios::sync_with_stdio();
	char buffer[1001];

	scanf("%d", &n);
	cin.ignore();
	
	for (int k=0; k<n; k++) {

		coll = 0;

		cin.getline(buffer, sizeof(buffer));
		
		for (j=0; buffer[j] != '\0'; j++) {
			
			switch (coll) {
				case 0:
					if (buffer[j] == 'H') coll++;
					break;
					
				case 1:
					if (buffer[j] == 'o') coll++;
					break;
					
				case 2:
					if (buffer[j] == 's') coll++;
					break;
					
				case 3:
					if (buffer[j] == 'h') coll++;
					break;
					
				case 4:
					if (buffer[j] == 'i') coll++;
					break;
					
				case 5:
					if (buffer[j] == 'n') coll++;
					break;
					
				case 6:
					if (buffer[j] == 'o') {
						buffer[j] = 'a';
					}
					
				default:
					coll = 0;
					break;
			}
		}
		
		for (i=0; i<j; i++) putchar(buffer[i]);
		putchar('\n');
		
	}
	return 0;
}

C++: #include <iostream>

int main (){
    std::string rightName = "Hoshina";
    std::string wrongName = "Hoshino";

    //num of data n
    int n = 0;
    std::cin >> n;
    //skip "\n"
    std::cin.ignore();
    for(int i = 0; i < n; ++i){
        std::string line;
        //input string
        getline(std::cin, line);
        //find exist of wrongName 
        std::string::size_type pos = line.find(wrongName);
        while(pos != std::string::npos){
            //rename to rightName
            line.replace(pos, wrongName.size(), rightName);
            pos = line.find(wrongName, pos + rightName.size());
        }

        std::cout << line << std::endl;
    }
}

C++: #include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){

	int N;
	string s,ans;
	string hoshino="Hoshino";
	string hoshina="Hoshina";

	cin>>N;getline(cin,s);
	for(int i=0;i<N;i++)
	{
		getline(cin,s);
	//	cout<<s;
		ans=s;
		while(1){
		int x=s.find("Hoshino",0);
		if(x==string::npos )break;
		for(int i=x;i<x+7;i++)
		{
			ans[i]=hoshina[i-x];
			s[i]='-';
		}
		
		}
cout<<ans<<endl;
	}
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<string>
 
using namespace std;
 
int main(void){
 
    int n;
    string bun;
	char inp;
 
    cin>>n;
    getchar();
    for(int i=0;i<n;i++){
		bun=("");
       while(1){
		   inp=getchar();
		   if(inp=='\n') break;
		   bun+=inp;
	   }
	   for(int cnt=6;cnt<bun.length()-1;cnt++){
           if(bun[cnt]=='o'&&bun[cnt-1]=='n'&&bun[cnt-2]=='i'&&bun[cnt-3]=='h'&&bun[cnt-4]=='s'&&bun[cnt-5]=='o'&&bun[cnt-6]=='H') bun[cnt]='a';
	   }
       cout<<bun<<endl;
    }
 
    return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <ctime>
#include <climits>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <tuple>
#include <bitset>
#include <unordered_map>

using namespace std;

int main() {
    const string search = "Hoshino";

    int n;
    cin >> n;
    cin.get();

    string text;
    while (n --) {
        getline(cin, text);
        for (int i=0; i<(int)text.size(); ) {
            int j;
            for (j=0; j<(int)search.size(); ++j) {
                if ((int)text.size() < i+j || search[j] != text[i+j]) {
                    break;
                }
            }
            if (j == (int)search.size()) {
                text[i+j-1] = 'a';
                i += j;
            } else {
                i += j + 1;
            }
        }
        cout << text << endl;
    }

    return 0;
}

C++: #include <stdio.h>
int main(){
    int n,now;
    char a[1000],c;
    while(scanf("%d",&n)!=EOF){
        scanf("\n");
        now=0;
        while(now<n){
        if(a[0]=='H'&&a[1]=='o'&&a[2]=='s'&&a[3]=='h'&&a[4]=='i'&&a[5]=='n'&&a[6]=='o')printf("Hoshina");
        else printf("%s",a);
        scanf("%c",&c);
        printf("%c",c);
            if(c=='\n')now++;
    }
    }
}

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;

        //文字列の読み込み
        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;
            std::cout << n << std::endl;
        }
        str = "";
        std::cin.clear();
        --n;
}