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 <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;
	while(n--){
		while(getline(cin,s)!="\n");
		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 <sstream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int n;
    cin >> n;
    char _;
    cin >> _;
    for (int i = 0; i < n; ++i) {
        string s;
        getline(cin, s);
        stringstream ss;
        ss << s;
        string t;
        vector<string> v;
        while (getline(ss, t, ' ')) {
            if (t == "Hoshino") {
                v.push_back("Hoshina");
            }
            else {
                v.push_back(t);
            }
        }
        for (size_t j = 0; j < v.size(); ++j) {
            cout << v[j];
            if (j == v.size() - 1) {
                cout << '\n';
            }
            else {
                cout << ' ';
            }
        }
    }
}

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

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

	std::cin >> num;

	getline(std::cin, str); // skip "\n"

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

		std::getline(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;

		start = 0;
	}

}

C++: #include<iostream>
#include<string.h>
using namespace std;
int main(){
  int n,m;
  string f,s;
  cin >> n;
  getline(cin, f);
  while(n--){
    getline(cin, s);
    while(1){
      m = s.find("Hoshino");
      if(m==-1) break;
      s = s.substr(0,m)+"Hoshina"+s.substr(m+7);
    }
    cout << s << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
/*
string HOSHINOtoHOSHINA(string str) {
  string str2(str);
  int idx = 0;
  int len = 7; // "Hoshina" has 7 character
  while( (idx = str2.find("Hoshino", idx)) >= 0) {
	str2.replace(idx, len, "Hoshina");
  }
  return str2;
}
*/
string replaceAAAtoBBB(const string& str) {
  string str2(str);
  string before = "Hoshino";
  string after = "Hoshina";
  int idx = 0;

  while( (idx = str2.find(before, idx)) >= 0) {
	str2.replace(idx, before.length(), after);
  }
  return str2;
}

int main() {
  int n;
  string buf;

  cin >> n;
  cin.ignore();
  
  for(int i = 0; i < n; ++i) {
	getline(cin, buf);
	//cout << HOSHINOtoHOSHINA(buf) << endl;
	cout << replaceAAAtoBBB(buf) << 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");
			}
		cout << s[i] << endl;
	}
	return 0; 
}

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

/**
* @brief インタフェース
*/
class IAizuPR
{
public:
    virtual std::string& executeEx() = 0;
};

/**
* @brief 文字列を操作する
*/
class AizuPR final : public IAizuPR
{
public:
    /**
    * @brief コンストラクタ
    */
    AizuPR(std::string& ss) :
        str(ss) ,
        bufCnt(0) {}

    /**
    * @brief デストラクタ
    */
    ~AizuPR() {}

public:
    /**
    * @fn std::string& executeEx()
    * @brief 文字列からHoshinoを検索し、Hoshinaへ変換する
    * @return std::string& 変換後の文字列
    */
    std::string& executeEx();

private:
    /**
    * @fn bool isFind(int& index)
    * @brief Hoshinoが含まれるか検索する
    * @param[out] index 開始位置
    * @return bool 含まれる場合はtrueを、そうでなければfalseを返す
    */
    bool isFind(int& index);

    /**
    * @fn void replace(int index)
    * @brief HoshinoをHoshinaに置き換える
    * @param[in] index 開始位置
    */
    void replace(int index);

private:
    //! "Hoshino"
    static const std::string Hoshino;

    //! "Hoshina"
    static const std::string Hoshina;

private:
    //! ターゲット文字列
    std::string str;

    //! バッファカウント
    int bufCnt;
};

const std::string AizuPR::Hoshino("Hoshino");
const std::string AizuPR::Hoshina("Hoshina");

std::string& AizuPR::executeEx()
{
    int tIdx = 0;
    std::string tStr(str);

    while (isFind(tIdx)) {
        replace(tIdx);
    }

    return str;
}

/**
* @brief コントロール
*/
class Control
{
public:
    /**
    * @fn void executeEx()
    * @brief データセット回文字列を読み込み、HoshinoをHoshinaへ変換し、表示する
    */
    void executeEx();

};

bool AizuPR::isFind(int& index)
{
    
    if (std::string::npos == (index = str.find(Hoshino, bufCnt))) {
        index = 0;
        return false;
    }

    bufCnt = index + Hoshina.length();

    return true;
}

void AizuPR::replace(int index)
{
    str.replace(index, Hoshino.length(), Hoshina);
}

void Control::executeEx()
{
    std::string in("");
    std::string out("");

    int size = 0;

    std::cin >> size;
    std::cin.ignore();

    for (int i = 0; i < size; i++) {
        std::getline(std::cin, in);

        IAizuPR* pAizuPR = new AizuPR(in);

        out = pAizuPR->executeEx();

        std::cout << out << std::endl;

        in.clear();

        out.clear();
        delete pAizuPR;
    }
}

/**
* @fn int main()
* @brief エントリポイント
*/
int main()
{
    Control().executeEx();
}

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

int main() {
	int n;
	cin >> n;
	for (int i = 0;i < n;i++) {
		string s;
		getline(cin, s);
		int a = s.size();

		if (a >= 7) {
			for (int j = 0;j < a - 6;j++) {
				string sb;
				sb = s.substr(j, 7);
				if (sb == "Hoshino") {
					s.replace(j, 7, "Hoshina");
				}
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

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

  cin >> n;
  //  cin.ignore();                                                             
  for (int i = 0; i < n ; ++i){
    getline(cin, s);
    while(1){
      pos = s.find("Hoshino");
      if(pos == -1) break;
      s[pos+6] = 'a';
    }
    cout << s << '\n';
  }
  return 0;
}

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

using namespace std;

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

}

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

using namespace std;

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

	cin >> n;

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

	return 0;
}