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 <stdio.h>
#include <string.h>

int main()
{
	int WordQuantity = 0,totalcnt = 0,alf = 0;
	char Hoshino[8] = {"Hoshino"};
	char Hoshina[8] = {"Hoshina"};
	int n;

	scanf("%d",&n);
	fflush(stdin);

	for(int loop = 0; loop < n; loop++){
		char words[1000][1001];
		char text[1001];
		totalcnt = 0;

		gets(text);
		fflush(stdin);

		for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
			for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
				words[WordQuantity][alf] = text[totalcnt];
				totalcnt++;
			}
			words[WordQuantity][alf] = '\0';
			totalcnt++;
		}

		for(int i = 0; i < WordQuantity; i++){
			if(strcmp(words[i],Hoshino) == 0){
				strcpy(words[i],Hoshina);
			}
		}

		for(int i = 0; i < WordQuantity-1; i++){
			printf("%s ",words[i]);
		}
		printf("%s\n",words[WordQuantity-1]);

	}

	return 0;
}

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 <vector>
#include <stdio.h>
#include <string>
#include <stdlib.h>

using namespace std;

int main(void){
//	FILE* fp_in = freopen("data.txt", "r", stdin);

	int n;
	string s;
	getline(cin, s);
	n = atoi(s.c_str());

	for(int i = 0; i < n; i++) {
		string str;
		getline(cin, str);
		for(int j = 0; j <= str.length() - 7; j++) {
			string sub;
			sub = str.substr(j, 7);

			if( sub == "Hoshino" )
				str[j + 6] = 'a';
			
		}
		cout << str << endl;
	}
	
 
//	while (1){}
	return 0;
}

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

int main(){
  std::string sent;
  int gyou,num=0;
  std::cin >> gyou;
  getline(std::cin, sent);
  for(int i=0;i<gyou;++i){
    num=0;
    getline(std::cin, sent);
    std::string bef="Hoshino",aft="Hoshina";
    while(num!=-1){
      num=(int)(sent.find(bef));
      if(num!=-1){
      sent.replace(num,bef.size(),aft);
      }
    }
    std::cout << sent << std::endl;
  }
  return 0; 
}

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

int main(){
	int n;
	char c;
	std::string str,Del;
	std::cin>>n;
	std::getline(std::cin,str);
	while( --n ,std::getline(std::cin,str) , n+1 ){
		int Result;
		while( (Result = str.find("Hoshino") ) != std::string::npos )str.replace(Result,strlen("Hoshino"),"Hoshina");
		std::cout<<str<<std::endl;
	}
}

C++: #include<stdio.h>
#include<string.h>
int main(){
    char sentence[1050];
    int n, i, j;
    scanf("%d\n", &n);
    for(i = 0;i < n;i++){
	for(j = 0;j < 1050;j++){
	    sentence[j] = getchar();
	    if(sentence[j] == '\n'){
		sentence[j] = 0;
		break;
	    }
	}
	for(j = 0;j < 1050;j++){
	    if(sentence[j] == 0)break;
	    if(!strncmp(sentence + j, "Hoshino", 7)){
		sentence[j + 6] = 'a';
	    }	     
	}
	puts(sentence);
    }
    return 0;
}