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 <cstdio>
#include <string>
using namespace std;

int main()
{
	int WordQuantity = 0,totalcnt = 0,alf = 0;
	char Hoshino[8] = {"Hoshino"};
	char Hoshina[8] = {"Hoshina"};
	int n;

	scanf("%d",&n);
	fflush(stdin);

	for(int loop = 0; loop < n; loop++){
		char words[1000][1001];
		char text[1001];
		totalcnt = 0;

		gets(text);
		fflush(stdin);

		for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
			for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
				words[WordQuantity][alf] = text[totalcnt];
				totalcnt++;
			}
			words[WordQuantity][alf] = '\0';
			totalcnt++;
		}

		for(int i = 0; i < WordQuantity; i++){
			if(strcmp(words[i],Hoshino) == 0){
				strcpy(words[i],Hoshina);
			}
		}

		for(int i = 0; i < WordQuantity-1; i++){
			printf("%s ",words[i]);
		}
		printf("%s\n",words[WordQuantity-1]);

	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int n;
	string s;
	string d="Hoshina";
	cin>>n;
	getline(cin,s);
	while(n--){
		getline(cin,s);
		while(1){
			unsigned int loc = s.find("Hoshino");
			if(loc!=string::npos)
			s.replace(loc,d.size(),d);
			else
				break;
		}
		cout<<s<<endl;
	}
	
}

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

using namespace std;

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

	string rect = "Hoshino";

	for (int t = 0; t < n; ++t) {
		char str[2000];
		while (scanf("%s", str) != EOF) {
			for (int i = 0; str[i]; ++i) {
				for (int j = 0; j < rect.size() && str[i+j]; ++j) {
					if (str[i+j] != rect[j]) break;
					else if (j == rect.size()-1) str[i+j] = 'a';
				}
			}

			cout << str;

			char c = getchar();
			if (c == '\r' || c == '\n') break;

			cout << " ";
		}
		cout << endl;
	}
}

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

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#define f first
#define s second

using namespace std;

typedef long long ll;

int main(){
  string str;
  int n;
  getline(cin, str); sscanf(str.c_str(),"%d",&n);
  while(n --> 0){
    int pos;
    getline(cin, str);
    while((pos = str.find("Hoshino")) != string::npos){
      str[pos+6] = 'a';
    }
    cout << str << endl;
  }
  return 0;
}

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

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

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

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<iostream>
#include<string>
using namespace std;

#define BAD "hoshino"

int hoge(void);

int main(){
	int n,i;
	
	cin>>n;
	for(i=0;i<n;i++){
	 hoge();
	}
	
	return 0;
}

int hoge(){
	string text;
	int i;
	
	cin>>text;
	for(i=0;i<text.length();i++){
	 if(text.substr(i,BAD.length())==BAD){
	  text[i+BAD.length()-1]='a';
	 }
	}
	
	cout<<text<<endl;
	return 0;
}

C++: 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <bitset>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
#define strtok_r strtok_s
#endif

#define ITER(c)             __typeof__((c).begin())
#define FOREACH(it, c)      for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)            __typeof__((c).rbegin())
#define RFOREACH(it, c)     for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)           REPEAT(i, 0, n)
#define RREP(i, n)          RREPEAT(i, 0, n)
#define REPEAT(i, k, n)     for(int i = (k); i < (k+n); ++i)
#define RREPEAT(i, k, n)    for(int i = (k)+(n)-1; i >= (k); --i)
#define FROMTO(i,f,t)       for(int i = f; i < t; i++)
#define ALL(c)              (c).begin(), (c).end()
#define LLPOW(p1,p2)        ((ll)pow((double)(p1), (int)p2))
#define ESIZEOF(A)          (sizeof(A)/sizeof((A)[0]))
#define CIN_NO_SYNC         do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)
#define GETSTR(p)           fgets((p), sizeof(p), stdin)
#define CHOMP(p)            do{ char *_q = (p) + strlen(p)-1; if(*_q == '\n' || *_q == '\r') *_q = 0; } while(0)
#define FILL(m,v)           memset(m, v, sizeof(m))
#define mp                  make_pair
#define pb                  push_back
template<class _T> _T MAX(_T p1,_T p2){return (p1>p2)?p1:p2;} 
template<class _T> _T MIN(_T p1,_T p2){return (p1<p2)?p1:p2;} 

typedef long long ll;
typedef unsigned long long ull;

#define X real()
#define Y imag()
typedef double D;
typedef complex<D> P;
#define EPS (1e-9)

#ifdef _DEBUG
template<class _T>
inline void _prfe(const char *_n, _T _c, bool _p = false){
    ITER(_c) _it=_c.begin();
    if(_p){ cout<<_n<<" = ["<<endl;for(;_it!=_c.end();++_it)cout<<"    "<<*_it<<endl;cout<<"]"<<endl; }
    else{ cout<<_n<<" = [ "<<*_it++;for(;_it!=_c.end();++_it)cout<<", "<<*_it;cout<<" ]"<<endl; }
}
#define pf printf
#define pr(n) do{cout<<#n" = "<<(n)<<endl;}while(0)
#define prfe(n) _prfe(#n, n)
#define prfep(n) _prfe(#n, n, true)
#define dbgchk(n) do{if(n)throw;}while(0)
#else
#define pf(...) /* */
#define pr(...) /* */
#define prfe(...) /* */
#define prfep(...) /* */
#define dbgchk(...) /* */
#endif

string solve(string &s){
    char *p = (char *)s.c_str();
    while(1){
        p = strstr(p, "Hoshino");
        if(p == NULL) break;
        memcpy(p, "Hoshina", 7);
    }
    return s;
}

int main(){
    int n;
    string s;
    getline(cin, s);
    stringstream ss(s);
    ss >> n;
    REP(i,n){
        getline(cin, s);
        cout << solve(s) << endl;
    }
    return 0;
}

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