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<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
char text[1001];
int main(){
    int i,ii,j,n,a;
    cin>>n;   
    for(i=0;i<=n;i++){
        gets(text);
		a=strlen(text);
		for(j=0;j<a-6;j++){
              if(text[j]=='H'&&text[j+1]=='o'&&text[j+2]=='s'&&text[j+3]=='h'&&text[j+4]=='i'&&text[j+5]=='n'&&text[j+6]=='o'){
                   text[j+6]='a';j+=6;
               }
            }
			if(i==0)continue;
            cout<<text<<endl;
    }

    return 0;
}

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

using namespace std;

int main()
{
    string S, P; int N;
    
    getline(cin, P);
    
    N = stoi(P);
    
    for(int i = 0; i < N; i++)
    {
        getline(cin, S);
        
        while(S.find("Hoshino") != string::npos)
        {
            S.replace(S.find("Hoshino"), 7, "Hoshina");
        }
        
        cout << S << endl;
    }
    
    return 0;
}

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

int main(){
	string x;
	int i=0,n;
	cin >> n;
	for (i = 0; i < n;i++){
		x = "";
		cin >> x;cin.ignore();
	
		string::size_type pos;
		while ((pos=x.find("Hoshino"))!= string::npos){
			x.replace(pos, 7, "Hoshina");
		}
		cout << x << endl;

	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(i=a; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++)

/*
  AOJ :: 0101
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0101&lang=jp
 */


int main(){
    int n,i;
    string in;

    cin >> n; cin.ignore();
    rep(i,n){
        getline(cin, in);
        while( true ){
            int p = in.find("Hoshino");
            if( p == string::npos ) break;
            in[p+6] = 'a';
        }
        cout << in << endl;
    }

    return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int ct;
	char* rp;
	char retu[1000];
	scanf("%d",&ct);
	fflush(stdin);
	for(int f1=0;f1<ct;f1++){
		gets(retu);
		while(1){
			if(strstr(retu,"Hoshino")==NULL){
				break;
			}
			if(rp=strstr(retu,"Hoshino")){
				rp+=6;
				*rp='a';
			}
		}
		printf("%s",retu);
	}
	return 0;
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;cin.ignore(2);

  for(int i=0;i<line_length;++i){
    string input;
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }
  return 0;
}

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

using namespace std;

int main()
{
	int a;
	char str[100];
	char str2[100][1000];
	
	cin >> a;
	
	for(int i = 0; i < a; i++){
		fgets(str2[i],1000,stdin);
	//	scanf("%s",str2[i]);
	}
	
	for(int i = 0; i < a; i++){
		for(int j = 0; str2[i][j] != '\n'; j++){
			if(str2[i][j] == 'H' && str2[i][j+1] == 'o' && str2[i][j+2] == 's' && str2[i][j+3] == 'h' && str2[i][j+4] == 'i' && str2[i][j+5] == 'n' && str2[i][j+6] == 'o'){
				str2[i][j+6] = 'a';
			}
		}
	}
	
	for(int i = 0; i < a; i++){
		printf("%s",str2[i]);
	}
}

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

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

    //std::vector<string> *str = new std::vector<string>[dataSetNum];
    std::vector< std::vector< std::string > > str;
    str.resize(dataSetNum);
    std::cin.ignore();
     //input & sprit
    for(int i = 0; i < dataSetNum; ++i){
        //input
        std::string tmp;
        std::string buf;
        getline(std::cin, tmp);
        std::stringstream ss(tmp);
        //sprit
        while( getline(ss, buf, ' ') ){
            str[i].push_back(buf);
        }
    }
    //replace
    for(int i = 0; i < dataSetNum; ++i){
        std::replace_if(str[i].begin(), str[i].end(),
    [](std::string x) { return x == "Hoshino"; }, "Hoshina");
    }
 
    //output
    for(int i = 0; i < dataSetNum; ++i){
    	std::string tmp;
    	tmp.clear();
    	tmp += str[i].front();
    	std::for_each(str[i].begin() + 1, str[i].end(),
    [&tmp](std::string x) { tmp += ' ' + x; } );
    	std::cout << tmp << std::endl;
    }

    return 0;
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	int n;
	cin >> n;
	string s;
	string sub;
	for (int i = 0; i < n; ++i) {
		cin >> s;
		for (int j = 0; j < s.size(); ++j) {
			if (s.size() < 7) {
				break;
			}
			sub = s.substr(j, 7);
			if (sub == "Hoshino") {
				s.replace(j, 7, "Hoshina");
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

using namespace std;

int main(void)
{
	int N;
	

	scanf("%d", &N);
	cin.get();
	while(--N, N>=0){
		char instr[1001];
		char *t;

		gets(instr);
		while( (t = strstr(instr, "Hoshino")) != NULL){
			t += 6;
			*t = 'a';
		}

		printf("%s\n", instr);
	}


	return 0;
}

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

int main() {
    std::string src = "Hoshino";
    std::string tar = "Hoshina";

    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

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

    std::string s;
    for (int i = 0; i < n; i++) {
        std::getline(std::cin, s);
        auto pos = s.find(src);
        while (pos != std::string::npos) {
            s.replace(pos, tar.length(), tar);
            pos = s.find(src, pos + tar.length());
        }

        std::cout << s << std::endl;
    }
}

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

int main()
{
    int n;
    cin >> n;cin.get( );
    //n++;
    string ss;
    for(int j=0;j<n;j++)
    {
        getline(cin,ss);
        int len =ss.size();
        for(int i=6;i<len;i++)
        {
            //cout << ss[i];
            if(ss.substr(i-6,7)=="Hoshino")
            {
                ss[i]='a';
            }
            //if(ss[i]=='\0')break;
        }

        /*for(int i=0;i<len;i++){
            if(ss[i]=='\0')break;
            cout <<ss[i];
        }*/
        cout <<ss << endl;
    }
    return 0;
}

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

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

int main(){
  int n;//回数
  cin >> n;
  cin.get();
  for(int i=0;i<n;i++){
  string s;
  getline(cin,s);//１行読み込む
  for(int i=0;i<s.size();i++){
    if(s.substr(i,7)=="Hoshino")
      s[i+6]='a';
  }
  cout << s << endl;
  }
}

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

int main()
{
	int n;
	cin>>n;
	cin.get();
	for(int i=0;i<n;i++){
		string s;
		getline(cin,s);
		for(int j=0;j<=s.size()-7;j++){
			if(s.substr(j,7)=="Hoshino")
				s[j+6]='a';
		}
		cout<<s<<endl;
	}
	return 0;

}