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 <string>

int main(){
	std::string str;
	int num;
	int start = 0;

	std::cin >> num;

	for(int i=0; i<num; ++i){

		std::cin >> str;

		while(start != -1){

			if(start == 0){ //for first loop
				start = (int)str.find("Hoshino", start);
			}else{
				start = (int)str.find("Hoshino", start+8);
			}

			if(start != -1){ //for first loop
				str.replace(start, start+7, "Hoshina");
			}

		}

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

}

C++: #include <iostream>
#include <string>
     
int main(){
    const std::string wrong_word("Hoshino");
    const std::string right_word("Hoshina");
       
    int num;
    std::cin >> num;
    std::cin.ignore(); // ignore next newline character
         
    for(int i = 0; i < num; ++i){
        std::string str;
        std::getline(std::cin, str);
           
        std::size_t pos = str.find(wrong_word);
        while(pos != std::string::npos){
            str.replace(pos, wrong_word.length(), right_word);
            pos = str.find(wrong_word);
        }
           
        std::cout << str << std::endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin>>n;
cin.ignore();

for (int i = 0; i < n; ++i) {
	string s;
	string a;
	getline(cin,s);
	stringstream ss(s);
	string ret;
	bool b=false;
	while(!ss.eof()){
		ss>>ret;
		if(b)cout<<" ";
		b=true;
		if(ret=="Hoshino"){cout<<"Hoshina";}
		else{cout<<ret;}
	}cout<<endl;
}
}

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

int main(void){
	std::string tmp;
	int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore();

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;

		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){
        	std::cout << *it << " ";
        }
        std::cout << std::endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string str;vector<string> vs;
    vs.clear();
    while(cin>>str){
      cin>>str;
      if(str=="Hoshino"){
	vs.push_back("Hoshina");
      }else
	vs.push_back(str);
    }
    for(int j=0;j<vs.size();j++){
      cout<<vs[j];
      if(j!=vs.size()-1)
	cout<<" ";
    }
    cout<<endl;
  }
  return 0;
}

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