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 <vector>
#include <string>
#include <cstdio>

static void inputSentences(std::vector<std::string>& sentences, int n)
{
  //fflush(stdin);
  std::string inputSentence;
  getline(std::cin, inputSentence);
  for (int i = 0; i < n; i++) {
    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<iostream>
#include<string>
using namespace std;

int main(){
	long double n;
	string spot;
	cin>>n;
	cin.ignore();
	for(long i=0;i<n;i++){
		getline(cin,spot);
		for(long j=0;j<spot.size()-6;j++){
			string str="";
			for(long k=j;k<j+7;k++){
				str+=spot[k];
			}
			if(str=="Hoshino"){
				spot[j+6]='a';
			}
		}
		cout<<spot<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main (int argc, char const* argv[]) {
  string right = "Hoshino";
  int N;
  cin >> N;
  cin.ignore();
  for (int z = 1; z <= N; z += 1) {
    string line;
    getline(cin, line);
    for (int i = 0; i < line.size(); i += 1) {
      if (line[i] == 'H') {
        if (line.size() >= i + right.size()) {
          bool flag = true;
          for (int j = 0; j < right.size(); j += 1) {
            if (right[j] != line[i+j]) {
              flag = false;
              break;
            }
          }
          if (flag) {
            line[i+right.size()-1] = 'a';    
          }
        }
      }
    }
    cout << line << endl;
    //
  }
  return 0;
}

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

using namespace std;

int main()
{
	int n, i, j;
	ios::sync_with_stdio();
	string s;

	scanf("%d", &n); cin.get();
	for (i=0; i<n; i++) {
		getline(cin, s);
		
		for (j=0; s[j+6] != '\0'; j++) {
			if (s.substr(j, 7) == "Hoshino") s[j+6] = 'a';
		}
		
		cout << s << endl;
		
	}
	return 0;
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	std::string str;
	
	while(std::cin >> str){

		std::string::size_type pos = str.find("Hoshino")
		
		while(pos != std::string::nops){
			 std::replace(pos, find_word.length(), correct_word);
			 pos = str.find(find_word, pos + find_word.length());
		}
	
	std::cout << str << std::endl;
	}
	return 0;
}

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

using namespace std;
  
int main(void){
    std::ios_base::sync_with_stdio(false);
  
    int n;
    string bun;
    char inp;
  
    cin>>n;
    getchar();
    for(int i=0;i<n;i++){
        bun=("");
       while(1){
           inp=getchar();
           if(inp=='\n') break;
           bun+=inp;
       }
       for(int cnt=6;cnt<bun.length();cnt++){
           if(bun[cnt]=='o'&&bun[cnt-1]=='n'&&bun[cnt-2]=='i'&&bun[cnt-3]=='h'&&bun[cnt-4]=='s'&&bun[cnt-5]=='o'&&bun[cnt-6]=='H') bun[cnt]='a';
       }
       cout<<bun<<endl;
    }
  
    return 0;
}

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

int main(){
  std::array<int, 4> a = {};
  std::array<int, 4> b = {};
  int hit = 0;
  int blow = 0;
  int N = 0;

  while(N <= 50 && std::cin >> a[0] >> a[1] >> a[2] >> a[3] && std::cin >> b[0] >> b[1] >> b[2] >> b[3]){
    

    for(int i = 0;i < 4;++i){
      for(int j = 0;j < 4;++j){
	if(a[i] == b[j] && i == j)
	  ++hit;
	if(a[i] == b[j] && i != j)
	  ++blow;
      }
    }
    std::cout << hit << " " << blow << std::endl;

    hit = 0;
    blow = 0;
    ++N;
  }
}

C++: #include<stdio.h>
int main(){
    int i,j,n,flag=0,d;
    char a[1000]={0};
 
    scanf("%d%*c",&n);
    for(j=0;j<n;j++){
        flag=0;
        for(i=0;;i++){
      scanf("%c", &a[i]);
      if(a[i]=='\n'){
    a[i]='\0';
    
    break;
      }
    }

        for(i=0;a[i]!=0;i++){
            //printf("%d ",flag);
            if(flag==0){
                if(a[i]=='H')flag++;
            }
            else if(flag==1){
                if(a[i]=='o')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==2){
                if(a[i]=='s')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==3){
                if(a[i]=='h')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==4){
                if(a[i]=='i')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==5){
                if(a[i]=='n')flag++;
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
            else if(flag==6){
                if(a[i]=='o')a[i]='a';
                else if(a[i]=='H')flag=1;
                else flag=0;
            }
        }
        for(i=0;a[i]!=0;i++)printf("%c",a[i]);//puts("");
        for(i=0;a[i]!=0;i++)a[i]=0;
    }
    return 0;
}