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 <string.h>
   int main() { 
    char befor[8] = "Hoshino";
     char in[1001],*torget; 
    int n;
    scanf("%d\n",&n);
     for(int i = 0; i < n; i++){
         gets(in);
         while( (torget = strstr(in,befor)) != NULL){     
torget += 6;
             *torget = 'a';
         }         printf("%s\n",in);
     }         
return 0; 
}

C++: #include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    int index;
    string s;

    cin >> n;
    cin.ignore();

    for(int i=0; i < n; i++)
    {
        getline(cin, s);

        while(true)
        {
            index = s.find("Hoshino");

            if(index == string::npos)
                break;
            else
                s.replace(index, 7, "Hoshina");
        }
        cout << s << endl;
    }

    return 0;
}

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

int main()
{
	char in[1001];
	int n;
	char hoshina[] = {"Hoshina"};
	string words;
	string::size_type hed;

	cin >> n;
	fflush(stdin);

	for(int i = 0; i < n; i++){
		gets(in);
		words = in;
		while(words.find("Hoshino") != string::npos){
			hed = words.find("Hoshino");
			for(int j = 0; j < 7; j++){
				words[hed] = hoshina[j];
				hed++;
			}
		}
		cout << words << endl;
	}

	return 0;
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int i,j,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char a[1050]={0};
        fflush(stdin);
        scanf("%[^\n]",a);
        fflush(stdin);
        for(j=0;j<strlen(a);j++)
        {
            if(a[j]=='H'&&a[j+1]=='o'&&a[j+2]=='s'&&a[j+3]=='h'&&a[j+4]=='i'&&a[j+5]=='n'&&a[j+6]=='o')
            {
                a[j+6]='a';
            }
        }
        printf("%s",a);
        //for(j = 0; j < 1050; j++)a[j]=0;
        fflush(stdin);
    }
    return 0;
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	
	int N;
	std::cin >> N;
	std::cin.ignore();

	for(int i = 0; i < N; ++i){
	
		std::string str;
		std::getline(std::cin,str);

		std::string::size_type pos = str.find(find_word); //find place of "Hoshino"
		
		while(pos != std::string::npos){
			str.replace(pos, find_word.length(), correct_word); //replace
			pos = str.find(find_word, pos + find_word.length()); //find place of "Hoshino"
		}
	
		std::cout << str << std::endl;
	
	}
	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;
    if(i<gyou-1)
    std::cout << std::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]);
		index=s[i].find("Hoshino",0);
			if(index!=string::npos){
				s[i].replace(index , 7 , "Hoshina");
			}
	}
	for(int i=0;i<n;++i){
		cout << s[i] << endl;
	}
	return 0; 
}

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

int main() {
	int n;
	cin >> n;
	getchar();
	while (n--) {
		cout << n << endl;
		vector<string> result;
		string line,word;
		getline(cin,line);
		istringstream stream(line);
		while (stream >> word) {
			if (word == "Hoshino") {
				result.push_back("Hoshina");
			}
			else {
				result.push_back(word);
			}
		}
		for (auto itr = result.begin();itr != result.end();++itr) {
			cout << *itr << (itr + 1 == result.end() ? "\n" : " ");
		}
	}
}

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

int main(){
	int n;
	std::string str;

	std::cin >> n;
	std::getline(std::cin, str);

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

		std::getline(std::cin, str);
		std::cout << "入力された文字列: " << str << std::endl;

		while(str.find("Hoshino") != std::string::npos){

			str.replace(str.find("Hoshino"), 7, "Hoshina");

		}

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

	return 0;
}

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

using namespace std;

void ReplaceStr(string& str, const string& from, const string& to)
{
	string::size_type pos = 0;
	while(pos = str.find(from, pos), pos != string::npos)
	{
		str.replace(pos, from.length( ), to);
		pos += to.length();
	}
}

void solve()
{
	int N;
	scanf("%d\n", &N);
	while(N--)
	{
		string str;
		getline(cin, str);
		string from = "Hoshino";
		string to = "Hoshina";
		ReplaceStr(str, from, to);
		cout << str << endl;
	}
}

int main()
{
	solve();
	return(0);
}

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

C++: #include <bits/stdc++.h>
using namespace std;

int main(void)
{
    string check = "Hoshino";
    int n; cin >> n;

    for (int i = 0; i < n; i++) {
        string str; 
        if(i == 0) cin.ignore();
        getline(cin, str);
        for (int j = 0; j < str.length()-6; j++) {
            for (int k = 0; k < 7; k++) {
                //printf("%c %c\n", check[k], str[j+k]);
                if (check[k] == str[j+k] && k < 6) continue;
                else if (check[k] == str[j+k] && k == 6) {
                    str[j+k] = 'a';
                } else break;
            }
        }
        cout << str << endl;
    }
    return 0;
}

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

int main(void){

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

    string text,s,ret;
    string str = "Hoshino";
    string astr = "Hoshina";

    for(int i = 0; i < n; ++i) {
        getline(cin, text);
        ret = text;
        for(int j = 0; j < text.length()-6; ++j) {
            s = text.substr(j,str.length());
            if (s.compare(str) == 0) {
                ret = text.replace(j, astr.length(), astr);
                break;
            }

        }

        cout << "ans: " << ret << endl;
    }

}

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

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