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;

    cin >> n;
    cin.get();
    string str;

    for(int i=1; i<=n; i++){
        getline(cin, str);
        while(str.find("Hoshino") != string::npos){
            str.at(str.find("Hoshino") + 6) = 'a';
        }
        cout << str << endl;
    }

    return 0;
}

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

int main(){
	int num;
	std::string fa = "Hoshino";
	std::string tr = "Hoshina";
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==fa){
					english[j]=tr;
			}
		}
		std::cout << english;
	}
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>

using namespace std;

int main()
{
    int n;
    string str;
    cin >> n;
    cin.get();
    for(int i=0;i<n;++i)
    {
        getline(cin, str);
        stringstream ss(str);
        str.clear();
        ss >> str;
        if(str=="Hoshino") str = "Hoshina";
        else if(str=="Hoshino.") str = "Hoshina.";
        cout << str;
        while(ss >> str)
        {
            if(str=="Hoshino") str = "Hoshina";
            else if(str=="Hoshino.") str = "Hoshina.";
            cout << ' ' << str;
        }
        cout << endl;
    }
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
int const MOD = 1000000007;
ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;}
int madd(int a, int b) {return (a + b) % MOD;}
int msub(int a, int b) {return (a - b + MOD) % MOD;}
int mmul(int a, int b) {return (a * b) % MOD;}
int minv(int a) {return mod_pow(a, MOD-2);}
int mdiv(int a, int b) {return mmul(a, minv(b));}

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

signed main() {
    int n, t; cin >> n; cin.ignore();
    rep(i,0,n) {
        string s; getline(cin, s);
        while((t = s.find("Hoshino")) != string::npos) {
            s.replace(t, 7, "Hoshina");
        }
        cout << s << endl;
    }
    return 0;
}

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

int main()
{
    int WordQuantity = 0,totalcnt = 0,alf = 0;
    char Hoshino[8] = {"Hoshino"};
    char Hoshina[8] = {"Hoshina"};
    int n;
 
    scanf("%d",&n);
    fflush(stdin);
 
    for(int loop = 0; loop < n; loop++){
        char words[1000][1001];
        char text[1001];
        totalcnt = 0;
 
        gets(text);
        fflush(stdin);
 
        for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
            for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
                words[WordQuantity][alf] = text[totalcnt];
                totalcnt++;
            }
            words[WordQuantity][alf] = '\0';
            totalcnt++;
        }
 
        for(int i = 0; i < WordQuantity; i++){
            if(strcmp(words[i],Hoshino) == 0){
                strcpy(words[i],Hoshina);
            }
        }
 
        for(int i = 0; i < WordQuantity-1; i++){
            printf("%s ",words[i]);
        }
        printf("%s\n",words[WordQuantity-1]);
 
    }
 
    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;
}

int main() {
  int n;
  string buf;

  cin >> n;
  cin.ignore();
  
  for(int i = 0; i < n; ++i) {
	getline(cin, buf);
	cout << HOSHINOtoHOSHINA(buf) << endl;
  }

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int n;
  cin>>n;
  cin.ignore();
  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 ;
      }else{
	cout<<s[i];
      }
    }
    cout<<endl;
  }

}

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

int main()
{
	int g,i;
	string ob;
	
	cin >> i;
	cin.get( );
	
	for(g=0;g<=i;g++){
		string::size_type pos;
		
		getline(cin, ob);
		while(pos=ob.find("Hoshino"), pos!=string::npos)ob.replace(pos, 7, "Hoshina");
		
		cout << ob << endl;
	}
	
	return 0;
}

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

static const std::string MISS_STR = "Hoshino";

int main(void) {
    int n;
    std::cin >> n;
    getchar();

    while (0 < n--) {
        std::string str;
        std::getline(std::cin, str);

        const unsigned int str_size = str.size();
        unsigned int cur = 0;
        std::string::size_type pos = str.find(MISS_STR, 0);

        while (pos != std::string::npos && cur <= str_size) {
            str[pos + 6] = 'a';

            // increase cursor
            cur += (pos + MISS_STR.size());
            pos = str.find(MISS_STR, cur);
        }

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

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)

int main(void){
    int n;
    string h = "Hoshino";
    string s;
    cin >> n;
    getline(cin, s);
    stringstream ss(s);
    ss >> n;
    rep(loop, n) {
        getline(cin, s);
        rep(i, s.size()-h.size()+1){
            bool same = true;
            rep(j, h.size()) {
                if(s[i+j]!=h[j]) {
                    same = false;
                    break;
                }
            }
            if(same) s[i+h.size()-1] = 'a';
        }
        cout << s << endl;
    }
}