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 <sstream>
#include <vector>
 
int main(void){
    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 line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

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