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>
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';
    d=i;
    break;
      }
    }

        for(i=0;i<d;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;i<d;i++)printf("%c",a[i]);//puts("");
        for(i=0;i<10000;i++)a[i]=0;
    }
    return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	string a;

	cin >> n;
	cin.ignore();

	for (int i = 0; i < n; ++i){
		int x = 0;
		getline(cin, a);
		if ((x = a.find("Hoshino")) >= 0)
			a.replace(x, strlen("Hoshino"), "Hoshina");
		cout << a << endl;
	}
	
	return 0;
}

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

int main(){

  int n, len;
  string str;

  cin >> n;
  getline(cin, str);
  for(int i=0; i<n; i++){
    getline(cin, str);
    len = str.length() - 6;
    for(int j=0; j<len; 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';
        j += 6;
      }
    }
    
    cout << str << endl;
  }

  return 0;

}

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

int main(){
    int line_num = 0;
    std :: string sentence, replaced = "Hoshino", replacing = "Hoshina";
    std :: cin >> line_num;
    std :: getline(std :: cin, sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, sentence);
        std::string::size_type pos = 0;
        while ((pos = sentence.find(replaced, pos)) != std::string::npos) {
            sentence.replace(pos, replaced.length(), replacing);
            pos += replaced.length();
        }
        std :: cout << sentence << std :: endl;
    }
}

C++: #include <stdio.h>
#include <string.h>
int main(){
  int i ,j ,n ,m;
  char str[1010];
  scanf( "%d " ,&n );
  for( i=0 ; i<n ; i++ ){
    fgets( str ,1000 ,stdin );
    m = strlen( str );
    for( j=0 ; j<m-6 ; j++ ){
      if( str[j] == 'H' ){
	if( str[j+1] == 'o' ){	
	  if( str[j+2] == 's' ){
	    if( str[j+3] == 'h' ){
	      if( str[j+4] == 'i' ){
		if( str[j+5] == 'n' ){
		  if( str[j+6] == 'o' ){
		    str[j+6] = 'a';
		    j += 6;
		  }
		}
	      }
	    }
	  }
	}
      }
    }
    printf( "%s" ,str );
  }

  return 0;
}

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

int main(){
	int num;
	std::string false = "Hoshino";
	std::string true = "Hoshina";
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==false) english[j]=true;
		}
		std::cout << english;
	}
    return 0;
}

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

using namespace std;

int main(void){
  string str;
  unsigned int pos;
  int n;
  cin >> n;
  cin.ignore();
  for(int i=0;i<n;i++){
	getline(cin,str);
	while(1){
	  pos = str.find("Hoshino",0);
	  if(pos == string::npos) break;
	  str.replace(pos,7,"Hoshina");
	}
	cout << str << endl;
  }
}

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

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;
            std::cout << n << std::endl;
        }
}

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

int main(void){
	std::string tmp;
	u_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 buf;
		std::string line; //outputted line data 

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		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 + " ";
        	}
        }
        std::cout << line << std::endl;
	}

	return 0;
}

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

int main(void){
	std::string str;

	while(std::cin >> str){
		std::string::size_type index;

		for(index = str.find("Hoshino"); index != std::string::npos; index = str.find("Hoshino",index + 6)){
			str.replace(index,7,"Hoshina");
		}

		std::cout << str << std::endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int n, gar;
    scanf("%d%*d", &n);
    rep(i,n){
        string s;
        getline(cin, s);
        while(s.find("Hoshino") < 40000){
            s.replace( s.find("Hoshino"), 7, "Hoshina");
        }
        cout << s << endl;
    }
}

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

int main(){
	int dataN,i,j,tmp;
	string str;
	
	cin>>dataN;
	for(j=0;j<dataN;j++){
	 if(j!=0){cout<<endl;}
	 cin>>str;
	 while(1){
	  tmp=str.find("Hoshino");
	  if(tmp==-1){break;}
	  str[tmp+6]='a';
	 }
	 cout<<str;
	}
	
	return 0;
}