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 <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(); j++) {
            string key = str.substr(j, 7), repl;
            if (key == "Hoshino") {
                repl = "Hoshina";
                for (int k = 0; k < 7; k++) {
                    str[j+k] = repl[k];
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };

int main(){
	ios::sync_with_stdio(false);

	string str1, str2, str3;

	str2="Hosino";
	str3="Hosina";

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

	while(n--){

		getline(cin, str1);

		string::size_type pos = str1.find(str2);

		while(pos!=string::npos){
			str1.replace(pos, str2.size(), str3);
			pos=str1.find(str2, pos+str3.size());
		}

		cout<<str1<<endl;
	}

}

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

using namespace std;

int main(){
        int n;
        scanf("%d ",&n);
        string a[2];
        for(int i=0;i<n;i++){
                getline(cin,a[i]);
                while(1){
                string::size_type index;
                index=a[i].find("Hoshino",index);
                if(string::npos==index)break;
                a[i][index+6]='a';
                }
        }
        for(int i=0;i<n;i++){
        cout<<a[i]<<"\n";
        }
}

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

using namespace std;

int main()
{
	int n;	cin>>n;cin.ignore();
	while(n--){
		string s;
		getline(cin,s);
		for(int i=0;i<s.length()-6;i++){
			if(s.substr(i,7)=="Hoshino")s.replace(i,7,"Hoshina");
		}
		cout<<s<<endl;
	}
	return 0;
}

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

using namespace std;

int main(void) {
    int n;
    char c;
    string s;

    cin >> n;
    cin.ignore();
    
    for (int i=0; i<n; i++) {
        getline(cin, s);
        while(s.find("Hoshino") != -1) {
            s.replace(s.find("Hoshino")+6, 1, "a");
        }
        cout << s << endl;
    }

    return 0;
}

C++: #include<stdio.h>
#include<string.h>
char a[1050]={0};
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        fflush(stdin);
        scanf("%[^\n]",a);
        fflush(stdin);
        for(j=0;j<1010;j++)
        {
            if(a[j]=='H'&&a[j+1]=='o'&&a[j+2]=='s'&&a[j+3]=='h'&&a[j+4]=='i'&&a[j+5]=='n'&&a[j+6]=='o')
            {
                a[j+6]='a';
            }
        }
        printf("%s\n",a);
        for(j = 0; j < 1050; j++)a[j]=0;
    }
    return 0;
}

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

int main() {
	string st;
	int n;
	string::size_type id;
	cin >> n;
	getchar();
	for (n;n>0;n--) {
		getline(cin,st);
		id=0;
		while(true) {
			id=st.find("Hoshino",id);
			if (id==string::npos) break;
			st.replace(id,7,"Hoshina");
			id++;
		}
    cout << st << endl;  
	}
	return 0;
	}

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

int main(){
	int n;
	cin >> n;
	string s;
	getline(cin,s);
	while(n--){
		vector<int> a,b;
		getline(cin,s);
		int pos = 0;
		while(~s.find("Hoshina",pos)){
			pos = s.find("Hoshina",pos)+1;
			a.push_back(pos-1);
		}
		while(~s.find("Hoshino",pos)){
			pos = s.find("Hoshino",pos)+1;
			b.push_back(pos-1);
		}
		for(int i=0;i<a.size();i++)
			s.replace(a[i],7,"Hoshino");
		for(int i=0;i<b.size();i++)
			s.replace(b[i],7,"Hoshina");
		cout << s << endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
string S; int n;
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		S = "";
		while (S == "")
		{
			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 <stdio.h>
#include <iostream>
#include <string>
 
using namespace std;
 
int main() {
    int n;
    string str;
    cin >> n;
    cin.ignore();
    while(n--) {
        getline(cin, str);
        int num;
        while(num = str.find("Hoshino"), num != -1) {
            str[num + 6] = 'a';
        }
        cout << str << endl;
    }
    return 0;
}

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

using namespace std;

int main()
{
   string str;
   int n;

   cin >> n;
   cin.ignore();

   for(int i = 0; i < n; ++i){

      getline( cin, str);

      while( string::npos != str.find( "Hoshino"))
      {
         int pnt = str.find( "Hoshino" );

         str.replace( pnt, 7, "Hoshina");
      }

      cout << str << endl;
   }
}

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

int main(){
	string str;
	int n;
	getline( cin, str );
	sscanf( str.c_str(), "%d", &n );

	for( int i=0; i<n; i++ ){
		getline( cin, str );
		unsigned int pos = 0;
		pos = str.find( "Hoshino", pos );
		while( pos != string::npos ){
			str.replace( pos, 7, "Hoshina" );
			pos = str.find( "Hoshino", pos );
		}
		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++) {
		fgets(str, sizeof(str), stdin);
		str[strlen(str) - 1] = '\0';

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

		fflush(stdin);
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  int n=3;

  cin>>n;
  rep(i,n+1){
    string s;
    getline(cin,s);
   if(s.size()<7)continue;
    rep(i,s.size()-6)if(s.substr(i,7)=="Hoshino")s.replace(i,7,"Hoshina");
    cout<<s<<endl;
  }


}

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

using namespace std;

int main(int argc, char const* argv[])
{
	string find_str("Hoshino"),rep_str("Hoshina"),target;
	int n;

	cin >> n;
	getchar();

	for( int i = 0;i < n;i++ ){
		getline(cin,target);
		for( string::size_type pos = target.find( find_str ); pos != string::npos; pos = target.find( find_str, rep_str.size() + pos ) ){
			target.replace( pos, find_str.size(), rep_str ); 
		}
		cout << target << endl;
	}
	return 0;
}