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>

int main(){
    int n;
    std::string str;
    std::string fr = "Hoshino";
    std::string to = "Hoshina";
    std::string::size_type pos;
    std::cin >> n;
    std::cin.get();
    
  
        //文字列の読み込み
    while(n > 0 && std::getline(std::cin, str)){
        //"Hoshino"を"Hoshina"に変換
        pos = str.find(fr);
        while(pos != std::string::npos){
            str.replace(pos, fr.size(), to);
            pos = str.find(fr, pos+to.size());
        }
        //表示
        std::cout << str << std::endl;
        str = "";
        std::cin.clear();
        --n;
    }
}

C++: #include <bits/stdc++.h>

using namespace std;
 
int main()
{
    string str;
    int n;
     
    cin >> n;
    cin.ignore();
    while (n--) {
        getline(cin, str);
        for (int j = 0; j < (int)str.size(); j++) {
            string key = str.substr(j, 7), repl;
            if (key == "Hoshino") {
                repl = "Hoshina";
                for (int k = 0; k < n; k++) {
                    str[j+k] = repl[k];
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

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

static void inputSentences(std::vector<std::string>& sentences, int n)
{
  fflush(stdin);
  for (int i = 0; i < n; i++) {
    std::string inputSentence;
    getline(std::cin, inputSentence);
    sentences.push_back(inputSentence);
  }
}

//static void convertSentencesCore(const std::string& targetBase,
//                                 const char afterConvert,
//                                 int convertPos,
//                                 std::vector<std::string>& sentences)
//{
//  for (std::vector<std::string>::iterator it = sentences.begin();
//    it != sentences.end();
//    ++it) {
//    /* ?????¬ */
//    if (*it == targetBase) {
//      it->at(convertPos) = afterConvert;
//      continue;
//    }
//    if (it->size() <= targetBase.size()) {
//      continue;
//    }
//    while(true) {
//      int find;
//      std::string targetStr;
//      bool findFlg = false;
//      /* ?????? */
//      targetStr = " " + targetBase + " ";
//      find = it->find(targetStr);
//      if (find != std::string::npos) {
//        it->at(find + convertPos + 1) = afterConvert;
//        findFlg = true;
//      }
//      /* ?????? */
//      targetStr = targetBase + " ";
//      find = it->find(targetStr);
//      if (find == 0) {
//        it->at(convertPos) = afterConvert;
//        findFlg = true;
//      }
//      /* ????°? */
//      targetStr = " " + targetBase;
//      find = it->find(targetStr);
//      if (find == it->size() - targetBase.size() - 1) {
//        it->at(find + convertPos + 1) = afterConvert;
//        findFlg = true;
//      }
//      if (findFlg == false) {
//        break;
//      }
//    }
//  }
//}
//
//static void convertSentences(std::vector<std::string>& sentences)
//{
//  convertSentencesCore("Hoshino", 'a', 6, sentences);
//  convertSentencesCore("Hoshino,", 'a', 6, sentences);
//  convertSentencesCore("Hoshino.", 'a', 6, sentences);
//}

static void convertSentences(std::vector<std::string>& sentences)
{
  const std::string from = "Hoshino";
  const std::string to = "Hoshina";
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    while (true) {
      std::string::size_type find = it->find(from);
      if (find == std::string::npos) {
        break;
      }
      else {
        //it->at(find + 6) = 'a';
        it->replace(find, from.size(), to);
      }
    }
  }
}

static void outputSentences(std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    std::cout << *it << std::endl;
  }
}

int main(void)
{
  int n;
  std::vector<std::string> sentences;

  std::cin >> n;

  inputSentences(sentences, n);
  convertSentences(sentences);
  outputSentences(sentences);

  return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

using namespace std;

int main(){
	int n=0;
	string str;
	cin >> n;
	getline(cin,str);
	for(int i=0;i<n;i++){
		getline(cin,str);
		for(int j=0;j<str.size();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>
#include <stdio.h>

#define N 1000

using namespace std;

int main()
{
	int n;
	int s;
	string str;

	cin >> n;
	cin.ignore();

	for(int i = 0; i < n; i++)
	{
		getline(cin,str);

		for(s = 0; s < N; s++){

		if(str[s] == 'H' && str[s+1] =='o' && str[s+2] == 's' && str[s+3] == 'h' 
			&& str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o' ){
				
				str[s] = 'H';
				str[s+1] = 'o';
				str[s+2] = 's';
				str[s+3] = 'h';
				str[s+4] = 'i';
				str[s+5] = 'n';
				str[s+6] = 'a';
			}

		}
		cout << str << endl;

	}
}

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

using namespace std;

int main()
{
	int n;
	string str;
	
	cin >> n;
	cin.ignore();
	while (n > 0){
		getline(cin, str);
		int len = 0;
		while (1){
			len = str.find("Hoshino", len);
			if (len == -1)  break;
			str[len + 6] = 'a';
		}
		cout << str << endl;
		n--;
	}
	return (0);
}

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

int main()
{
	int n, i;
	string s;
	stringstream ss;

	getline(cin, s);
	ss.str(s);
	ss>>n;
	for (i = 0; i < n; i++) {
		getline(cin, s);
		while (s.find("Hoshino") != string::npos)
			s[s.find("Hoshino")+6] = 'a';
		cout<<s<<endl;
	}

	return 0;
}

C++: #include <stdio.h>
int main(){
    int n,now;
    char a[1000],c;
    while(scanf("%d",&n)!=EOF){
        scanf("\n");
        now=0;
        while(now<n){
        if(a[0]=='H'&&a[1]=='o'&&a[2]=='s'&&a[3]=='h'&&a[4]=='i'&&a[5]=='n'&&a[6]=='o'&&a[7]=='\0')printf("Hoshina");
        else printf("%s",a);
        scanf("%c",&c);
        printf("%c",c);
            if(c=='\n')now++;
        a[7]='\0';
    }
    }
}

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