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>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
using namespace std;
#define MAX_SIZE 10000
typedef pair<int, int> pii;
#define MAX 99999999

int main(){
    
    int n;
    cin >> n;
    //	cout << n << endl;
    int j;
    bool checking  = true;
    for( j = 0; j<=n; j++)
    {
        checking = true;
        char s[MAX_SIZE] = {};
        gets(s);
        int i = 0;
        while(*(s+i) != '\0')
        {
            //printf("%c",*(s+i));
            bool check = true;
            if(*(s+i) == 'H')
                if(*(s+i+1) == 'o')
                    if(*(s+i+2) =='s' )
                        if(*(s+i+3) =='h' )
                            if(*(s+i+4) == 'i')
                                if(*(s+i+5) == 'n' )
                                    if(*(s+i+6) == 'o')
                                    {
                                        cout << "Hoshina";
                                        i+=7;
                                        check = false;
                                        checking = check;
                                    } 
            if(*(s+i) != 'H' || check  == true)
            {
                printf("%c",*(s+i));
                i++;
            }
            checking = true;
        }	
        if(j)cout << endl;
        if(checking == false)
        {
            cout << endl;
            checking = true;
        }
        cout << endl;
    }
    return 0;
    
}

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