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[1099];
    string s;
    int test,k;
    char ch;

    cin>>test;
    cin.ignore();

    while(test--)
    {
        k=0;
        while(cin>>s)
        {
            if(s==" ")
                continue;

            str[k]=s;
            ch=getchar();
            if(ch=='\n')
                break;
            k++;
        }

        for(int i=0; i<=k; i++)
        {
            if(str[i]=="Hoshino")
                str[i]="Hoshina";
        }

        for(int i=0;i<=k;i++)
            cout<<str[i]<<" ";
        cout<<endl;

       // memset(str,'\0',sizeof(str));

       for(int i=0;i<=k;i++)
        str[i]="";
    }
    return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

//?????????s???????????????f?????¨???t??????????????? 
string replaceAll(string s, string f, string t) {
	string::size_type pos = s.find(f);
	while (pos != string::npos) {
		s.replace(pos, f.size(), t);
		pos = s.find(f, pos + t.size());
	}
	return s;
}

signed main() {
	int n; cin >> n; cin.ignore();
	rep(i, 0, n) {
		string s; getline(cin, s);
		cout << replaceAll(s, "Hoshino", "Hoshina") << endl;
	}
	return 0;
}

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

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;
	for(j=0;j<n;j++){
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c==endl){
	   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<stdio.h>
int main(){
    int i,j,n,flag=0;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        scanf("%c",&a[0]);
        for(i=1;;i++){
            scanf("%c",&a[i]);
if(a[i]=='\n'){
a[i]=0;
break;
}}
        for(i=0;a[i]!=0;i++){
            //printf("%d ",flag);
            if(flag==0){
                if(a[i]=='H')flag++;
            }
            else if(flag==1){
                if(a[i]=='o')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==2){
                if(a[i]=='s')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==3){
                if(a[i]=='h')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==4){
                if(a[i]=='i')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==5){
                if(a[i]=='n')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==6){
                if(a[i]=='o')a[i]='a';
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
        }
        for(i=0;a[i]!=0;i++)printf("%c",a[i]);//puts("");
        for(i=0;a[i]!=0;i++)a[i]=0;
    }
    return 0;
}

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

int main() {
	int n;
	cin >> n;
	cin.ignore();
	while (n--) {
		string line,word;
		getline(cin,line);
		string::size_type hoshino_pos;
		while ((hoshino_pos = line.find("Hoshino")) != string::npos) {
			line.replace(hoshino_pos + 6,1,"a");
		}
		cout << line << endl;
	}
}

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

int main(){
	std::string str;
	int num;
	int start = 0;

	std::cin >> num;

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

		std::cin >> str;

		while(start != -1){

			if(start == 0){ //for first loop
				start = (int)str.find("Hoshino", start);
			}else{
				start = (int)str.find("Hoshino", start+8);
			}

			if(start != -1){ //for first loop
				str.replace(start, start+7, "Hoshina");
			}

		}

		std::cout << str << std::endl;
	}

}

C++: #include <iostream>
#include <string>
     
int main(){
    const std::string wrong_word("Hoshino");
    const std::string right_word("Hoshina");
       
    int num;
    std::cin >> num;
    std::cin.ignore(); // ignore next newline character
         
    for(int i = 0; i < num; ++i){
        std::string str;
        std::getline(std::cin, str);
           
        std::size_t pos = str.find(wrong_word);
        while(pos != std::string::npos){
            str.replace(pos, wrong_word.length(), right_word);
            pos = str.find(wrong_word);
        }
           
        std::cout << str << std::endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin>>n;
cin.ignore();

for (int i = 0; i < n; ++i) {
	string s;
	string a;
	getline(cin,s);
	stringstream ss(s);
	string ret;
	bool b=false;
	while(!ss.eof()){
		ss>>ret;
		if(b)cout<<" ";
		b=true;
		if(ret=="Hoshino"){cout<<"Hoshina";}
		else{cout<<ret;}
	}cout<<endl;
}
}

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

int main(void){
	std::string tmp;
	int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore();

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	std::cout << *it << " ";
        }
        std::cout << std::endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string str;vector<string> vs;
    vs.clear();
    while(cin>>str){
      cin>>str;
      if(str=="Hoshino"){
	vs.push_back("Hoshina");
      }else
	vs.push_back(str);
    }
    for(int j=0;j<vs.size();j++){
      cout<<vs[j];
      if(j!=vs.size()-1)
	cout<<" ";
    }
    cout<<endl;
  }
  return 0;
}