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>
 
int main(){
	const std::string wrong_word("Hoshino");
	const std::string right_word("Hoshina");
	int num;
	std::cin >> num;
	std::cin.ignore();
	 
	for(int i = 0; i < num; ++i){
		std::string str;
		std::getline(std::cin, str);
		std::string::size_type pos = str.find(wrong_word);
		 
		while(pos != std::string::npos){
			str.replace(pos, wrong_word.length(), right_word);
			pos = str.find(wrong_word);
		}
		std::cout << str << std::endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define sz(obj) ((int)(obj).size())

int main()
{
  string str;
  int n;
  cin >> n;
  cin.get();
  while (n--){
    getline(cin, str);
    REP(i, sz(str) - 6){
      if (str.substr(i, 7) == "Hoshino") str.replace(i, 7, "Hoshina");
    }
    cout << str << endl;
  }
}

C++: #include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main(){
int n,s;
string str;
	scanf("%d\n",&n);
for(int i=0;i<n;i++){
	getline(cin,str);
	s=str.size();
for(int j=0;j<s-6;j++){
if(str[j]=='H'&&str[j+1]=='o'&&str[j+2]=='s'&&str[j+3]=='h'&&str[j+4]=='i'&&str[j+5]=='n'&&str[j+6]=='o')str[j+6]='a';
}
cout<<str<<endl;
}
return 0;
}

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

int main(void)
{

	string instr;
	int N;

	cin >> N;

	cin.get();	//改行無視るための一文字読み込み関数（今回は()の中は何も書かない）
	for(int i = 0; i < N; i++){
		getline(cin, instr);
		for(int i = 0; i < instr.length(); i++){
			if(instr.substr(i, 7) == "Hoshino"){
				instr[i+6] = 'a';
				i += 5;
			}
		}
		cout << instr << endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  int n; cin >> n;
  getchar();

  while (n--) {
    string s;
    getline(cin, s);

    for (int i = 0, st = 0; i < s.size(); ++i) {
      char c = s[i];
      if (st == 0 && c == 'H') st = 1;
      else if (st == 1 && c == 'o') st = 2;
      else if (st == 2 && c == 's') st = 3;
      else if (st == 3 && c == 'h') st = 4;
      else if (st == 4 && c == 'i') st = 5;
      else if (st == 5 && c == 'n') st = 6;
      else if (st == 6 && c == 'o') st = 7;
      else st = 0;

      if (st == 7) {
        st = 0;
        cout << 'a';
      }
      else {
        cout << c;
      }
    }
    cout << endl;
  }

  return 0;
}

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

int main(){
	int n;
	string line;
	scanf("%d ",&n);
	
	for(int x=0;x<n;x++){
		getline(cin,line);
		while (line.find("Hoshino") != string::npos) {
			line.replace(line.find("Hoshino"), 7, "Hoshina");
		}
		cout << line << endl;
    }
	return 0;
}

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

int main(){
  int n;
  char c;
  int f;

  cin >> n;
  getchar();

  f = 0;
  while(n){
    c = getchar();
    
    if(f == 1){
      if(c == 'o')f++;
      else f = 0;
    }else if(f == 2){
      if(c == 's')f++;
      else f = 0;
    }else if(f == 3){
      if(c == 'h')f++;
      else f = 0;
    }else if(f == 4){
      if(c == 'i')f++;
      else f = 0;
    }else if(f == 5){
      if(c == 'n')f++;
      else f = 0;
    }else if(f == 6){
      if(c == 'o'){
	putchar('a');
	f++;
      }else f = 0;
    }

    if(c == 'H')f = 1;

    if(c == '\n')n--;

    if(f==7)f = 0;
    else putchar(c);
  }
}

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

int main(void){
	std::string tmp;
	u_int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore(); //delete cin buffer

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	if(it == (str.end() - 1)){
           		std::cout << *it << std::endl;
        	}else{
        		std::cout << *it << " ";
        	}
        }
	}

	return 0;
}

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

int main(){
	int num;
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		while(english.find("Hoshino") != -1){
			int find = english.find("Hoshino");
			english.replace(find, find+6, "Hoshina");
		}
		std::cout << english;
	}
    return 0;
}

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

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

C++: #include<bits/stdc++.h>
using namespace std;

int main()
{
    string str[1099];
    string s;
    int test,k;
    char ch;

    cin>>test;
    cin.ignore();

    while(test--)
    {
        k=0;
        while(cin>>s)
        {
            if(s==" ")
                continue;

            str[k]=s;
            ch=getchar();
            if(ch=='\n')
                break;
            k++;
        }

        for(int i=0; i<=k; i++)
        {
            if(str[i]=="Hoshino")
                str[i]="Hoshina";
        }

        for(int i=0;i<=k;i++)
            cout<<str[i]<<" ";
        cout<<endl;

       // memset(str,'\0',sizeof(str));
    }
    return 0;
}

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

int main(){
	int n, j;
	cin >> n;
	char s[1001];
	gets(s);
	for (int i = 0; i < n; i++) {
		//string s;
		//cin >> s;
		gets(s);
		for (j = 0; j < 1000-6; j++) {
			if (s[j + 6] == 0)
				break;
			if (s[j] == 'H'&&s[j + 1] == 'o'&&s[j + 2] == 's'&&s[j + 3] == 'h'&&s[j + 4] == 'i'&&s[j + 5] == 'n'&&s[j + 6] == 'o')
				s[j + 6] = 'a';
		}
		cout << s << endl;
		for (j += 5; j >= 0; j--) {
			s[j] = 0;
		}
	}
	

}