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(){
    int n;
    string s;
    string c = "Hoshina";
    cin >> n;
    cin.ignore();
    while(n--){
        getline(cin,s);
        while(s.find("Hoshino") != string::npos){
            s.replace(s.find("Hoshino"),c.size(),c);
        }
        cout << s << endl;
    }
}

C++: readline.to_i.times do 
  puts readline.chomp.gsub(/Hoshino/, 'Hoshina')
end

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

int main() {
  int n;
  cin >> n;
  while(n--) {
    string s, t, u;
    getline(cin, s);
    t = "Hoshino";
    u = "Hoshina";
    for(int i = 0; i < s.size(); ++i) {
      if(s.substr(i, t.size()) == t) {
        cout << u;
        i += t.size() - 1;
      }
    }
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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

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

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

int main()
{
	int n;
	std::string s;
	std::vector<std::string> vec;
	
	std::cin >> n;
	
	for( int i = 0; i < n + 1; i++ ){
		std::getline( std::cin, s );
		if( s.find( "\n" ) == std::string::npos )vec.push_back( s );
	}
	
	for( std::vector<std::string>::iterator it = vec.begin(); it != vec.end(); it++ ){
		while( it->find( "Hoshino" ) != std::string::npos ){
			it->replace( it->find( "Hoshino" ), 7, "Hoshina" );
		}
		if( *it != "" ) std::cout << *it << std::endl;
	}

 	return 0;
}

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

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

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

C++: #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(i=a; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++)

/*
  AOJ :: 0101
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0101&lang=jp
 */

string all_replace(const string& str, const string& target, const string& parts){
    string result = str;
    int p = 0;

    while( (p = result.find(target, p)) != string::npos ){
        result.replace(p, target.length(), parts);
        p += target.length() + 1;
    }
    return result;
}

int main(){
    int n,i;
    string in;

    cin >> n; cin.ignore();
    rep(i,n){
        getline(cin, in);
        cout << all_replace(in, "Hoshino", "Hoshina") << endl;
    }

    return 0;
}

C++: #include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(void){
	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 << 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;
};

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

};

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

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;
    cin.ignore();
    for (int i = 0; i < n; i++){
		string str;
		int pos = 0;
        getline(cin, str);
        while (1){
            pos = str.find("Hoshino", pos);
            if (pos == -1)  break;
            str[pos + 6] = 'a';
        }
        cout << str << endl;
    }
    return (0);
}

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

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

	}
		return 0;
}