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 <string.h>

using namespace std;

int main()
{
	int n, i, j;
	ios::sync_with_stdio();
	string s;

	scanf("%d", &n); cin.get();
	for (i=0; i<n; i++) {
		getline(cin, s);
		
		for (j=0; j+6 < s.size(); j++) {
			if (s.substr(j, 7) == "Hoshino") s[j+6] = 'a';
		}
		
		cout << s << endl;
		
	}
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    string s;
    getline(cin, s);
    int T = atoi(s.c_str());
    while (T--) {
        getline(cin, s);
        if (s.size() && s[s.size()-1] == '\r') s.resize(s.size()-1);
        size_t ix = 0;
        while ((ix = s.find("Hoshino", ix)) != string::npos) {
            s[ix+6] = 'a';
        }
        cout << s << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int rep(string a,int *loc){
	*loc = a.find("Hoshino");
	return *loc;
}
int main(){
	string a,t="Hoshina";
	int n,loc;
	cin >> n;
	getline(cin,a);
	while(n--){
		loc=0;
		getline(cin,a);
		while(!rep(a,&loc)) a.replace(loc,t.length(),t);
		cout << a << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cin.ignore();
  string line;
  string s = "Hoshina";
  while((getline, line))
  {
  
    }
  cout<<"Hoshina"<<endl;
 cout<<"Hashino"<<endl;
 cout<<"Masayuki Hoshina was the grandson of Ieyasu Tokugawa."<<endl;
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
	int n,index;
	cin>>n;
	cin.ignore();
	vector<string> s(n);
	for(int i=0;i<n ; ++i){
		getline(cin,s[i]);
		while(s[i].find("Hoshino",0)!=string::npos){
			index=s[i].find("Hoshino",0);
			s[i].replace(index , 7 , "Hoshina");
		}
	}
	for(int i=0;i<n;++i){
		cout << s[i] << endl;
	}
	return 0; 
}

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

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 <sstream>
#include <vector>
 
int main(void){
    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 line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") == -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

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

using namespace std;

int main(void){
//	FILE* fp_in = freopen("data.txt", "r", stdin);

	int n;
	string s;
	getline(cin, s);
	n = atoi(s.c_str());

	for(int i = 0; i < n; i++) {
		string str;
		getline(cin, str);
		for(int j = 0; j <= str.length() - 7; j++) {
			string sub;
			sub = str.substr(j, 7);

			if( sub == "Hoshino" )
				str[j + 6] = 'a';
			
		}
		cout << str << endl;
	}
	
 
//	while (1){}
	return 0;
}

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

int main(){
  std::string sent;
  int gyou,num=0;
  std::cin >> gyou;
  getline(std::cin, sent);
  for(int i=0;i<gyou;++i){
    num=0;
    getline(std::cin, sent);
    std::string bef="Hoshino",aft="Hoshina";
    while(num!=-1){
      num=(int)(sent.find(bef));
      if(num!=-1){
      sent.replace(num,bef.size(),aft);
      }
    }
    std::cout << sent << std::endl;
  }
  return 0; 
}

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

int main(){
	int n;
	char c;
	std::string str,Del;
	std::cin>>n;
	std::getline(std::cin,str);
	while( --n ,std::getline(std::cin,str) , n+1 ){
		int Result;
		while( (Result = str.find("Hoshino") ) != std::string::npos )str.replace(Result,strlen("Hoshino"),"Hoshina");
		std::cout<<str<<std::endl;
	}
}

C++: #include<stdio.h>
#include<string.h>
int main(){
    char sentence[1050];
    int n, i, j;
    scanf("%d\n", &n);
    for(i = 0;i < n;i++){
	for(j = 0;j < 1050;j++){
	    sentence[j] = getchar();
	    if(sentence[j] == '\n'){
		sentence[j] = 0;
		break;
	    }
	}
	for(j = 0;j < 1050;j++){
	    if(sentence[j] == 0)break;
	    if(!strncmp(sentence + j, "Hoshino", 7)){
		sentence[j + 6] = 'a';
	    }	     
	}
	puts(sentence);
    }
    return 0;
}