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 <iostream>
#include <string>

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        std::string text;
        getline(std::cin, text);
        
        u_int index = 0;
        while((index = text.find(str_false, index)) != std::string::npos){
            text.replace(index, str_false.size(), str_true);
            index += str_false.size();
        }
        std::cout  << text << std::endl;
    }
    
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	int n; scanf("%d%*c", &n);
	rep(i, n) {
		string s; getline(cin, s);
		regex re("Hoshino");
		cout << regex_replace(s, re, "Hoshina") << endl;
	}
}

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

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

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

		while (1) {
			if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
			else break;
		}
		puts(str);

		fflush(stdin);
	}

	return 0;
}

C++: #include<stdio.h>

int main()
{
	int n,i,j=0,k;
	char alph,str[1008],temp;
	
	scanf("%d",&n);
	temp=getchar();
	for(i=0;i<n;i++){
		for(j=0;;j++){
			str[j] = getchar();
			if(str[j] == '\n'){
				str[j] = '\0';
				break;
			}
		}
		for(k=0;k<j;k++){
			if(str[k]=='A' && str[k+1]=='o' && str[k+2]=='s' && str[k+3]=='h' && str[k+4]=='i' && str[k+5]=='n' && str[k+6]=='o'){
				str[k+6]='a';
			}
		}
		printf("%s\n",str);
	}
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <sstream>
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;


int main()
{
	const string src = "Hoshino";
	const string des = "Hoshina";

	int n;
	string in;
	getline (cin, in );
	stringstream ss (in );
	ss >> n;
	vector <string> str (n );
	rep (i, n ){
		getline (cin, str[i] );
	} // end rep
	rep (i, n ){
		while (str[i].find (src ) != string::npos ){
			 str[i] = str[i].replace (str[i].find (src ), des.length(), des );
		} // end while
	} // end 
	rep (i, n ){
		cout << str[i] << endl;
	} // end rep
		
	return 0;
}

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

int main(){
    int n; //dataset number
    std::string before = "Hoshino";
    std::string after = "Hoshina";

    std::cin >> n;

    //std::vector<std::string> strList;
    
    for(int i = 0; i <= n; ++i){
        std::string str;
        std::getline(std::cin, str);
        std::string::size_type pos = str.find(before);
        while(pos != std::string::npos){
            str.replace(pos, before.size(), after);
            pos = str.find(before, pos + after.size());
        }
	std::cout << str << std::endl;
	//strList[i] = str;
    }

    /*
    for(int i = 0; i < n; ++i){
        std::cout << strList[i] << std::endl;
    }
    */
    return 0;
}

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

using namespace std;
 
int main()
{
    string str;
    int n;
     
    cin >> n;
    getline(cin, str);
    while (n--) {
        getline(cin, str);
        for (int j = 0; j < (int)str.length(); 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 <stdio.h>
#include <string.h>

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

	scanf("%d\n", &n);
	for (int i = 0; i < n; i++) {
		gets(str);

		while (1) {
			if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
			else break;
		}

		puts(str);
	}

	return 0;
}

C++: #include <iostream>

using namespace std;
int main(){
	int d;
	cin>>d;
	string buf;
	string key="Hoshino";
	string newkey="Hoshina";
	unsigned int p;
getline(cin,buf);
	while(d--){
		getline(cin,buf);
		while((p=buf.find("key"))!=string::npos){
			buf.replace(p,key.size(),newkey);
		}
		cout<<buf<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	int n;
	string b;
	cin>>n;
	for(int j=0;j<n;j++){
		cin>>b;
		for(int i=0;i<b.size()-6;i++){
			if(b[i]=='H'&&b[i+1]=='o'&&b[i+2]=='s'&&b[i+3]=='h'&&b[i+4]=='i'&&b[i+5]=='n'&&b[i+6]=='o'){
				b[i+6]='a';
			}
		}
		for(int i=0;i<b.size();i++)
			cout<<b[i];
		cout<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int main(){
	int n;
	cin >> n;
	getchar();
	while(n > 0){
	    char a[2000] = {0};
	    scanf("%[^\n]",a);
	    getchar();
	    int len = 0;
	    for(int i = 0; a[i] != 0; i++) len++;
	    for(int i = 0; i < len; i++){
            if(a[i] == 'H' && a[i+1] == 'o' && a[i+2] == 's' && a[i+3] == 'h' && a[i+4] == 'i' && a[i+5] == 'n' && a[i+6] == 'o') a[i+6] = 'a';
	    }
	    printf("%s\n",a);
        n--;
	}
	return 0;
}

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==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 <iostream>
#include <vector>
#include <algorithm>
#include <string>

int main(){

    int dataSetNum;
    std::cin >> dataSetNum;

    std::vector< std::string > str;
    str.resize(dataSetNum);
    std::cin.ignore();

    //input 
    for(int i = 0; i < dataSetNum; ++i){
        //input
        std::string tmp;
        getline(std::cin, tmp);
        str[i] = tmp;
    }

    //replace
    for(int i = 0; i < dataSetNum; ++i){
    	const std::string tmp("Hoshino");
        auto pos = str[i].find(tmp);
        while(pos != std::string::npos){
        	str[i].replace( pos, 7, "Hoshima" );
        	pos = str[i].find(tmp, pos + 7);
        }
    }
    
    //output
    	std::for_each(str.begin() , str.end(),
    [](std::string x) { std::cout << x << std::endl; } );

    return 0;
}