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

using namespace std;

int main(){
	int n,start;
	string s;

	cin >> n;

	scanf("%*s");

	for(int i=0;i<n;i++){
		std::getline(cin,s);
		while(1){
			start = s.find("Hoshino",0);
			if(string::npos==start)break;
			s.replace(start,7,"Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

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

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

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

	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){
        	if(it == (str.end() - 1)){
           		std::cout << *it << std::endl;
        	}else{
        		std::cout << *it << " ";
        	}
        }
	}

	return 0;
}

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

int main(){

  char s[1001];
  char word[8]; word[7]='\0';
  int n;
  int j;

  cin >> n;
  getchar();

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

    gets(s);
    j=0;

    while(s[j+7]!='\n'){


        for(int k=0; k<7; k++){
          if(s[j+k]==' '){ break; }
          word[k]=s[j+k];
        }

        //cout << "test:" <<word << endl;


        if(strcmp(word,"Hoshino")==0){
          s[j+6]='a';
        }
      
      j++;
    }
    cout << s << endl;
  }


  return 0;

}

C++: #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
int n;
using namespace std;
int main(){
	std::ios::sync_with_stdio(false);
	cin>>n;
	for(int i=0;i<n;i++){
		string a;
		while(cin>>a&&a!="\n"){
			if(a=="Hoshino"){
				a="Hoshina";
			}
			cout<<a<<" ";
		}
		cout<<"\n";
	}
	return 0;
}

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

using namespace std;

int main () {
	int n,i,count=0;
	int temp,temp1;
	string s;
	string bef = "Hoshino";
	string aft = "Hoshina";
	scanf("%d",&n);
	cin.ignore();
	for(i=0;i<n;i++)
	{
		getline(cin,s);
		string::size_type pos = s.find(bef);
		while(pos != string::npos){
			s.replace(pos, bef.size(), aft);
			pos = s.find(bef, pos + aft.size());
		}
		printf("%s\n",s.c_str());
	}
}

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

int main() {
    string str;
    getline(cin, str);
    int n = str[0] - '0';
    for (int i = 0; i < n; i++) {
        string input;
        getline(cin, input);
        while (input.find("Hoshino") != string::npos) {
            input.replace(input.find("Hoshino"), 7, "Hoshina");
        }
        cout << input << endl;
    }
}

C++: #include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

int main(void){
	int n;
	int a,b;
	int s;
	string str;
	cin >> n;
	getline(cin,str);
	for(a=0;a<=n;a++){
		getline(cin,str);
        s=str.size();
		for(b=0;b<s;b++){
			if(str[b]=='H' && str[b+1]=='o' && str[b+2]=='s' && str[b+3]=='h' && str[b+4]=='i' && str[b+5]=='n' && str[b+6]=='o')str[b+6]='a';
		}
		cout << str << endl;

	}
}

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

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

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

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

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

		while(is >> tmp){ //input word
			if(tmp.find("Hoshino") != -1){ //judge word
				tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
			}
			str.push_back(tmp); //add word to list
		}

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

	return 0;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<bitset>
#include<map>
#include<set>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<cstdlib>
using namespace std;

string convert(string org){
	string name = "Hoshin";
	int i = 0;
	int j = 0;
	while(org[i]!=0){
		while(org[i]!=0 && name[j]!=0 && org[i]==name[j]){
			++i;++j;
		}
		if(j==name.size()){
			org[i] = 'a';
		}
		++i;
		j = 0;
	}
	return org;
}

int main(){
	int n;
	string line;
	getline(cin,line);
	sscanf(line.c_str(),"%d",&n);
	for(int x=0;x<n;++x){
		getline(cin,line);
		line = convert(line);
		cout<<line<<endl;
	}
	return 0;
}

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

int main(){
    int n;
    std::string str;
    std::string fr = "Hoshino";
    std::string to = "Hoshina";
    std::string::size_type pos;
    std::cin >> n;
    //std::cin.get();
    
  
        //文字列の読み込み
    while(n > 0 && std::getline(std::cin, str)){
        //"Hoshino"を"Hoshina"に変換
        pos = str.find(fr);
        while(pos != std::string::npos){
            str.replace(pos, fr.size(), to);
            pos = str.find(fr, pos+to.size());
        }
        //表示
        std::cout << str << std::endl;
        str = "";
        std::cin.clear();
        --n;
    }
}

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

int main(){
    int dataSetNum;
    std::cin >> 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 = 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<algorithm>
#include<string>
using namespace std;
int main()
{
	int c,n;
	string s;
	string ho="Hoshino";
	cin >> n;
	for (int r = 0; r <= n; r++){
		s.clear();
		while ((c = getchar()) != '\n'){
			s += c;
		}
		for (int i = 0; i < s.size(); i++){
			int flag = 0;
			if (s[i] == 'H'){
				for (int i2 = 0; i2 < ho.size(); i2++){
					if (s[i + i2] != ho[i2]){
						flag = 1;
						break;
					}
				}
				if (flag == 0){
					s[i + ho.size() - 1] = 'a';
				}
			}
		}
		if (r != 0){
			cout << s << endl;
		}
	}
}