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(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 <cstring>

using namespace std;

int main()
{
	int n;
	string str;
	
	cin >> n;
	cin.ignore();
	while (n > 0){
		getline(cin, str);
		int len = 1;
		while (1){
			len = str.find("Hoshino", len - 1);
			if (len == -1)  break;
			str[len + 6] = 'a';
		}
		cout << str << endl;
		n--;
	}
	return (0);
}

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

int main(void)
{
	int i, j;
	int n;
	int len;
	char str[1024];
	
	scanf("%d\n", &n);
	
	for (j = 0; j < n; j++){
		fgets(str, 1024, stdin);
		
		len = strlen(str);
		for (i = 0; i < len; i++){
			if (strncmp(&str[i], "Hoshino", 7) == 0){
				strncpy(&str[i], "Hoshina", 7);
			}
		}
		printf("%s", str);
	}
	
	return (0);
}

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

string replaceWholeSentence(const string& str, string before, string after) {
  string str2(str);
  int idx = 0;

  while( (idx = str2.find(before, idx)) >= 0) {
	str2.replace(idx, before.length(), after);
  }
  return str2;
}

int main() {
  int n;
  string buf;

  cin >> n;
  cin.ignore();
  
  for(int i = 0; i < n; ++i) {
	getline(cin, buf);
	cout << replaceWholeSentence(buf, "Hoshino", "Hoshina") << endl;
  }

  return 0;
}

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

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>

int main()
{
    const std::string str_false = "Hoshino";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::string text;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        getline(std::cin, text);
        u_int index;
        
        while((index = text.find(str_false, index)) != std::string::npos)
            text.replace(index, str_false.size(), str_true);
        std::cout  << text << std::endl;
    }
    
    return 0;
}

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

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

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

	std::cin >> num;

	getline(std::cin, str); // skip "\n"

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

		std::getline(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, 7, "Hoshina");
			}

		}

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

		start = 0;
	}

}

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

int n;
std::string str[3];

void reserve(std::string& ss, const std::string str1, const std::string str2) {
	for (int i = 0; i < ss.size() - str1.size() + 1; ++i) {
		std::string s;
		for (int j = i; j < i + str1.size(); ++j)
			s += ss[j];
		if (s == str1) {
			for (int j = i; j < i + str1.size(); ++j)
				ss[j] = str2[j - i];
		}
	}
}

int main() {
	std::cin >> n;
	for (int i = 0; i < 3; ++i)
		std::getline(std::cin, str[i]);
	for (int i = 0; i < 3; ++i)
		reserve(str[i], "Hoshino", "Hoshina");
	for (int i = 0; i < 3; ++i)
		std::cout << str[i] << std::endl;

	return 0;
}

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

using namespace std;

int main(void){
	int n;
	string str;
	cin >> n;
	cin.get();
	for(int i = 0;i < n;i++){
		getline(cin,str);
		while(str.find("Hoshino") != string::npos){
			int lc = str.find("Hoshino");
			lc += 6;
			str[lc] = 'a';
		}
		cout << str << endl;
	}
	return 0;
}

C++: //#include <bits/c++.h>
#include <iostream>
#include <cstdio>
#define rep(i,n) for(int i = 0; i< n; i++)
#define MAX_SIZE 1010

using namespace std;

int main(){
	
	int n;
	cin >> n;
//	cout << n << endl;
	for(int j = 0; j<=n; j++)
	{
	
		char s[MAX_SIZE] = {};
		gets(s);
		int i = 0;
		while(*(s+i) != '\0')
		{
			//printf("%c",*(s+i));
	         	bool check = true;
			if(*(s+i) == 'H')
		         if(*(s+i+1) == 'o')
			   if(*(s+i+2) =='s' )	
				if(*(s+i+3) =='h' )
					if(*(s+i+4) == 'i')
						if(*(s+i+5) == 'n' )
						if(*(s+i+6) == 'o')
						{
							cout << "Hoshina";
							i+=7;
							check = false;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			
		}	
		 if(j)cout << endl;
	}
	if(j == false)
		cout << endl;  
	return 0;

}

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

int main(){
  int n;
  string key="Hoshino";
  cin>>n;cin.ignore();
  for(int i=0;i<n;i++){
    string str;
    int j=0,k=0;
    getline(cin,str);
    while(str[j]!=0){
      if(key[k]==str[j])k++;
      else k=0;
      if(k==7){
	if(str[j+1]==' ' || str[j+1]==0){
	str[j]='a';
	}
	k=0;
      }
      j++;
    }
    cout<<str<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

vector<string> split(const string& input)
{
	istringstream stream(input);

	string field;
	vector<string> result;
	while( std::getline(stream, field, ' ') )
	{
		result.push_back(field);
	}
	return result;
}

int main()
{
	int n;

	scanf("%d\n", &n);
	loop(i, 0, n)
	{
		string line;
		std::getline(cin, line);
		
		vector<string> words = split(line);
		for(vector<string>::iterator it = words.begin(); it != words.end(); it++)
		{
			string showStr = *it;
			int findPos = 0;
			if( (findPos = showStr.find("Hoshino")) != string::npos )
			{
				showStr.replace(findPos, 7, "Hoshina");
			}
			printf("%s ", showStr.c_str());
		}
		cout << endl;
	}
	return (0);
}