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 <cstdio>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;

int main(void)
{
    string str;
    int n;
    
    scanf("%d\n", &n);
    for (int i = 0; i < n; i++){
        getline(cin,str);
        for (int j = 0; j < str.size(); j++){
            if (str[j] == 'H'){
                if ((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;
                }
            }
        }
        printf("%s\n", str.c_str());
    }
    
    return (0);
}

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

int main() {
  string str,line;
  int n,k=0;
  char *words[1000];
  cin >> n;
  getline(cin,line);
  for(int i=0;i<n;i++) {
    getline(cin,line);
    stringstream ss(line);

    while(ss >> str) {
      k++;
    }
    ss.str("");
    ss.clear(stringstream::goodbit);
    stringstream xx(line);
    for(int i=0;i<k-1;i++) {
      xx >> str;
      if(str == "Hoshino")
        cout << "Hoshina" << " ";
      else
        cout << str << " ";
    }
    xx >> str;
    if(str == "Hoshino")
      cout << "Hoshina" << endl;
    /*
    else if(str == "Hoshino.")
      cout << "Hoshina." << endl;
    */
    else
      cout << str << endl;
    k=0;
  }
}

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

int main(void){
  char sentence[1050];
  int n;
  scanf("%d\n",&n);
  for(int i=0;i<n;i++){
        for(int j=0;j<1050;j++){
            sentence[j]=getchar();
            if(sentence[j]=='\n'){
                sentence[j]=0;
                break;
            }
        }
    for(int j=0;j<1025;j++){
        if(sentence[j]==0)break;
        if(!strncmp(sentence+j,"Hoshino",7)){
            sentence[j+6]='a';
        }
    }
    puts(sentence);
  }
  return 0;
    
}

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

int main() {
  string str,line;
  int n,k=0;
  char *words[1000];
  cin >> n;
  getline(cin,line);
  for(int i=0;i<n;i++) {
    getline(cin,line);
    stringstream ss(line);

    while(ss >> str) {
      k++;
    }
    ss.str("");
    ss.clear(stringstream::goodbit);
    stringstream xx(line);
    for(int i=0;i<k-1;i++) {
      xx >> str;
      if(str == "Hoshino")
        cout << "Hoshina" << " ";
      else
        cout << str << " ";
    }
    xx >> str;
    if(str == "Hoshino")
      cout << "Hoshina" << endl;
    else if(str == "Hoshino.")
      cout << "Hoshina." << endl;
    else
      cout << str << endl;
    k=0;
  }
}

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

int main(void)
{
    char str[1005];
    int n;
    
    scanf("%d\n", &n);
    for (int i = 0; i < n; i++){
        scanf("%[^\n]", str);
        int l = (int)strlen(str);
        for (int j = 0; j < l; j++){
            if (str[j] == 'H'){
                if ((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;
                }
            }
        }
        printf("%s\n", str);
    }
    
    return (0);
}

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

void Hoshina(string& str){
	for(unsigned int i=0; i<str.size()-6; ++i){
		if(str[i] == 'H' && str[i+1] == 'o' && str[i+2] == 's' && str[i+3] == 'h' && str[i+4] == 'i' && str[i+5] == 'n' && str[i+6] == 'o'){
			str[i+6] = 'a';
		}
	}
	cout << str << endl;
}

int main() {
	int n;
	string str;
	cin >> n;
	cin.ignore();
	for(int i=0; i<n; ++i){
		getline(cin,str);
		Hoshina(str);
		cin.ignore();
	}
	return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		string str[1000];
		char a;
		int c=0;
		cin>>str[c];
		scanf("%c",&a);
		c++;
		while(a!='\n'){
			cin>>str[c];
			scanf("%c",&a);
			c++;
		}
		for(int i2=0;i2<c-1;i2++){
			if(str[i2]=="Hoshino")
				printf("Hoshina ");
			else
				printf("%s ",str[i2].c_str());
		}
		if(str[c-1]=="Hoshino")
			printf("Hoshina\n");
		else
			printf("%s\n",str[c-1].c_str());
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
	bool flg = false;
	int n, i, c;
	string w, s;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		c = 0;
		s = "";
		while (1)
		{
			w = "";
			cin >> w;
			if (w.compare("Hoshino") == 0)	s += "Hoshina";
			else							s += w;
			if (cin.get() == '\n') break;
			s += " ";
		}
		s.erase(s.end(), s.end());
		cout << s << endl;
	}
	return 0;
}

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

int main(void){
  string sen;
  int n;
  cin >> n;
  cin.ignore();
  for(int i = 0; i < n; i++){
    getline(cin, sen);
    int k = 0;
    while(true){
      k = sen.find("Hoshino", k);
      if(k < 0) break;
      sen[k+6] = 'a';
      k++;
    }
    cout << sen << 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;
    int j;
	for( 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 <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();

	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<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
using namespace std;

int main(){
	int N;
	cin>>N;
	cin.ignore();
	while(N--){
		char S[1001];
		for(int i=0;;i++){
			scanf("%c",&S[i]);
			if(S[i]=='\n'){
				S[i] = '\0'; break;
			}
		}
		int len = strlen(S);
		for(int i=0;i<len;i++){
			if(strncmp(S+i,"Hoshino",7)==0){
				printf("Hoshina"); i += 6;
			}
			else printf("%c",S[i]);
		}puts("");
	}
    return 0;
}