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 <vector>
using namespace std;

int main()
{
	int n;
	string str;
	cin >> n;
	getline(cin,str);	//nを入力する際、エンターでの改行をgetlineで読み込んで出力まで処理してしまうため、改行のみを読み込むgetlineを用意する。
	while (n--)
	{
		getline(cin, str);
		for (int i = 0; i < str.size(); i++)
		{
			if (str[i] == 'H' && str[i + 1] == 'o' && str[i + 2] == 's' && str[i + 3] == 'h' && str[i + 4] == 'i' && str[i + 5] == 'n' && str[i + 6] == 'o')
			{
				str[i + 6] = 'a';
			}
		}
		cout << str << endl;
	}
	return 0;
}

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

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

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 convertSentences(std::vector<std::string>& sentences)
{
  const std::string targetBase = "Hoshino";
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    /* ?????¬ */
    if (*it == targetBase) {
      it->at(6) = 'a';
      continue;
    }
    if (it->size() <= 7) {
      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 + 7) = 'a';
        findFlg = true;
      }
      /* ?????? */
      targetStr = targetBase + " ";
      find = it->find(targetStr);
      if (find == 0) {
        it->at(6) = 'a';
        findFlg = true;
      }
      /* ????°? */
      targetStr = " " + targetBase;
      find = it->find(targetStr);
      if (find == it->size() - 8) {
        it->at(it->size() - 1) = 'a';
        findFlg = true;
      }
      if (findFlg == false) {
        break;
      }
    }
  }
}

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 <sstream>
#include <iostream>
#include <array>

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    //std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  string str1;
  cin>>n;
  cin.ignore();
  for(int i=0;i<n;i++){
    getline(cin,str1);
    while(str1.find("Hoshino")!=string::npos){
      str1.replace(str1.find("Hoshino"),7,"Hoshina");
    }
    cout<<str1<<endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int main()
{
	int n;
	cin >> n;
	while(getchar()!='\n');
	for(int i=0;i<n;i++)
	{
		char str[1001];
		char *p;
		fgets(str,sizeof(str),stdin);
		while(strstr(str,"Hoshino")!=NULL)
		{
			p=strstr(str,"Hoshino");
			*(p+6) = 'a';
		}
		cout << str << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <cstdio>
using namespace std;
int main(){
  int n ,i=0 ,index;
  string s;
  cin >> n;
  cin.ignore();

  while( i < n ){
    getline(cin,s);
    while( true ){
      string::size_type index = s.find( "Hoshino" );
      if( index != string :: npos ){
	s.replace( index ,7 ,"Hoshina" );
      }
      else{
	break;
      }
    }
    cout << s << endl;
    i++;
  }
}

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

string repStr(string &obj, string from, string to) {
    int pos = obj.find(from);
    int toLen = to.length();
 
    if (from.empty()) {
        return obj;
    }
 
    while ((pos = obj.find(from, pos)) != string::npos) {
        obj.replace(pos, from.length(), to);
        pos += toLen;
    }
    return obj;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    cin.ignore();
    while(--n >= 0){
        string s;
        getline(cin,s);
        repStr(s, "Hoshino", "Hoshina");
        cout << s << endl;
    }
    return EXIT_SUCCESS;
}

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