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

int main()
{
    int n;
    cin >> n;
    for(int j=0;j<=n;j++)
    {
        string ss;
        getline(cin,ss);
        //if(cin.eof())break;
        int len =ss.size();
        for(int i=0;i<1001;i++)
        {
            cout << ss[i];
            if(ss[i]=='H')
            {
                if(ss.substr(i,7)=="Hoshino")
                {
                    ss[i+6]='a';
                    i += 6;
                }
            }
            if(ss[i]=='\0')break;
        }

        for(int i=0;i<len;i++){
            if(ss[i]=='\0')break;
            cout <<ss[i];
        }
        cout << endl;
        //cout << ss << endl;
    }
    return 0;
}

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

int main(){
	int n;
	while(cin>>n){
		string s;
		bool fir=true;
		while(cin>>s){
			if(!fir)cout<<" ";
			if(s=="Hoshino")cout<<"Hoshina";
			else cout<<s;
			if(s.find('\n')!=string::npos)break;
			fir=false;
		}
		cout<<endl;
	}	
}

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

using namespace std;

int main(void){
  int line_length;
  cin>>line_length;
  getline(cin, str);

  for(int i=0;i<line_length;++i){
    string input;
    getline(cin,input);
    std::string::size_type pos;
    while(( pos = input.find("Hoshino")) != std::string::npos){
      input.replace(pos, 7, "Hoshina");
    }
    cout << input<<endl;
  }
  return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

bool is_change(string str,char* tmp,int pos, int len){
	const char A[] = {'H','o','s','h','i','n','a'};
	if(str.substr(pos,len) == "Hoshino"){
		for(int i=pos,j=0;i<pos+len,j<7;i++,j++){
			tmp[i] = A[j];
		}
		return true;
	}

	return false;
}

int main(){

	string str;
	while(getline(cin,str)){
		int n;
		sscanf(str.c_str(),"%d",&n);
		for(int i=0;i<n;i++){
			getline(cin,str);
			char tmp[2048];
			strcpy(tmp,str.c_str());
			for(int i=0;i+6<str.size();i++){
				if(is_change(str,tmp,i,7)) i+=7;
			}

			cout << tmp << endl;
		}
	}
}

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

const string src = "Hoshino";
bool check(string str,int n,int m){
    if(str[n]==src[m]){
        if(m==6) return true;
        return check(str,n+1,m+1);
    }
        return false;
}
int main(){
    int n;
    scanf("%d",&n);
    string *str=new string[n];
    for(int i=0;i<n+1;i++){
        getline(cin,str[i]);
        for(int j=0;j<str[i].size();j++){
            if(check(str[i],j,0)){
                str[i][j+6]='a';
                j+=5;
            }
        }
    }
    for(int i=0;i<n+1;i++){
        cout << str[i];
        if(i) cout << endl;
    }
    return 0;
}

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

int main()
{
	char befor[8] = "Hoshino";
	char in[1001],*torget;
	int n;

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

	for(int i = 0; i < n; i++){
		gets(in);
		while( (torget = strstr(in,befor)) != NULL){
			torget += 6;
			*torget = 'a';
		}
		printf("%s\n",in);
	}


	return 0;
}

C++: #include<stdio.h>

int main()
{
	int b=0,c;
	char a[1000];
	while(scanf("%c",&a[b])!=EOF)
		b++;
	for(c=6;c<b;c++)
	{
		if(a[b-6]=='H',a[c-5]=='o',a[c-4]=='s',a[c-3]=='h',a[c-2]=='i',a[c-1]=='n',a[c]=='o')
			a[c]='a';
	}
	for(c=0;c<b;c++)
		printf("%c",a[c]);
}

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

int main(){

    int dataSetNum;
    std::cin >> dataSetNum;

    std::vector< std::string > str;
    str.resize(dataSetNum);
    std::cin.ignore();

    //input 
    for(int i = 0; i < dataSetNum; ++i){
        //input
        std::string tmp;
        getline(std::cin, tmp);
        str[i] = tmp;
    }

    //replace
    for(int i = 0; i < dataSetNum; ++i){
    	const std::string tmp("Hoshino");
        auto pos = str[i].find(tmp);
        while(pos != std::string::npos){
        	str[i].replace( pos, 7, "Hoshina" );
        	pos = str[i].find(tmp, pos + 7);
        }
    }
    
    //output
    	std::for_each(str.begin() , str.end(),
    [](std::string x) { std::cout << x << std::endl; } );

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i,n) for(i=0;i<n;++i)
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define mp make_pair
#define pb push_back
#define fi first
#define sc second

int main(int argc, char const *argv[]) {
  int i,j;

  int n;
  scanf("%d\n",&n);
  for(int T=0; T<n; ++T){
    string s;
    getline(cin,s);

    string h="Hoshino";
    string r="Hoshina";

    if(h.size()<=s.size()){
      rep(i,s.size()-h.size()+1){
        if(s.substr(i,h.size())==h){
          s[i+h.size()-1]='a';
        }
      }
    }

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

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



int main(){
	std::string str;
	u_int data_num;
	std::cin >> data_num;
	std::cin.ignore();
	for(u_int i = 0; i < data_num; ++i){
		int loc = 0;
		std::getline(std::cin, str);
		while((loc = str.find("Hoshino", loc)) != -1){
			str[loc+6] = 'a';	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  string cc,c;
  string base[2]={"Hoshino","Hoshina"};
  int n,x;
  cin >> n;
  getline(cin,c);
  for(int i=0;i<n;i++){
    getline(cin,cc);
    x = 0;
    while(1){
      if(x==0) x = cc.find(base[0],x);
      else if(x>0) x = cc.find(base[0],x+7);
      if(x==-1) break;
      cc.replace(x,7,base[1]);
    }
    cout << cc << endl;
  }
    return 0;
}

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<string> *str = new std::vector<string>[dataSetNum];
	//input & sprit
	for(int i = 0; i < dataSetNum; ++i){
		//input
		std::string tmp;
		std::string buf;

		std::cin >> tmp;

		std::stringstream ss(tmp);
		//sprit
		while( getline(ss, buf, ' ') ){
			str[i].push_back(buf);
		}

	}

	//replace
	for(int i = 0; i < dataSetNum; ++i){
		std::replace_if(str[i].begin(), str[i].end(),
    [](string x) { return x == 'Hoshino'; }, 'Hoshina');
	}

	//output
	for(int i = 0; i < dataSetNum; ++i){
		std::for_each(str[i].begin(), str[i].end(),
    [](string x) { std::cout << x << std::endl; });
}
	}
	return 0;
}

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

int main(){
	int n;
	string line;
	scanf("%d ",&n);
	
	for(int x=0;x<n;x++){
		getline(cin,line);
		while (line.find("Hoshino") != string::npos) {
			line.replace(line.find("Hoshino"), 7, "Hoshina");
		}
		cout << line << 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;
    }
}