Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	n, _ := strconv.Atoi(stdin.Text())

	for i := 0; i < n; i++ {
		stdin.Scan()
		fmt.Println(strings.Replace(stdin.Text(), "Hoshino", "Hoshina", -1))
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string str;
	int n;
	cin>>n;
	while(n>=0){
	getline(cin,str);
	for(int i=0;i<str.size();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';
	n--;
	cout<<str<<endl;
	}
}

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

int main()
{
	int n;

	cin >> n;
	cin.ignore( 1, '\n' );

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

	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
char text[1001];
int main(){
    int i,ii,j,n,a;
    cin>>n;   
    for(i=0;i<n;i++){
		while(gets(text)){a=strlen(text);
		    for(j=0;j<a-6;j++){
		       if(text[j]=='H'&&text[j+1]=='o'&&text[j+2]=='s'&&text[j+3]=='h'&&text[j+4]=='i'&&text[j+5]=='n'&&text[j+6]=='o'){
                    text[j+6]='a';j+=6;
               }
            }
            cout<<text;
        }
    }
    return 0;
}

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

int main(){
    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";

    std::cin >> data_set_num;

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

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

using namespace std;

int main(){
	string s;
	int n;
	int c_pos;
	cin>>n;
	cin.ignore();
	while(n--){
		getline(cin,s);
		while((c_pos=s.find("Hoshino"))!=string::npos){
			s.replace(c_pos,7,"Hoshina");
		}
		cout<<s<<endl;
	}
}

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();
}