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

int main(){
	int n,j;
	int flg;
	char c;
	
	cin>>n;
	for(j=0;j<n;j++){
	 //??\????????????
	 flg=0;
	 while(1){
	  c=getchar();
	  if(c=='\n'){
	   break;
	  }else{
	   switch(flg){
		case 0:
		if(c=='H'){flg++;}
		break;
		case 1:
		if(c=='o'){flg++;}else{flg=0;}
		break;
		case 2:
		if(c=='s'){flg++;}else{flg=0;}
		break;
		case 3:
		if(c=='h'){flg++;}else{flg=0;}
		break;
		case 4:
		if(c=='i'){flg++;}else{flg=0;}
		break;
		case 5:
		if(c=='n'){flg++;}else{flg=0;}
		break;
		case 6:
		if(c=='o'){c='a';}
		flg=0;
		break;
	   }
	   cout<<c;
	  }
	 }
	 cout<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

const string from = "Hoshino";
const string to = "Hoshina";

int main()
{
    int n;

    cin >> n;
    cin.ignore();
    
    while (n--) {
        string inp;

        getline(cin, inp);
        string::size_type pos = 0;
        while (pos = inp.find(from, pos), pos != string::npos) {
            inp.replace(pos, to.length(), to);
            pos += to.length();
        }
        cout << inp << endl;
    }

    return 0;
}

C++: #include <iostream>

int main(){
	
	int count;
	std::cin >> count;
	//改行を無視
	std::cin.get();
	
	const std::string before_word = "Hoshino";
	const int before_word_length = before_word.length();
	const std::string after_word = "Hoshina";
	
	for(int i = 0; i < count; ++i){
		std::string str;
		std::getline(std::cin, str);
		
		//全ての"Hoshino"を置換するまで無限ループ
		while(true){
			std::size_t found = str.find(before_word);
			if(found != std::string::npos){
				str.replace(found, before_word_length, after_word);
			}
			else break;
		}
		
		std::cout << str << std::endl;
	}
	
	return 0;
}

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    cin.ignore();

    while (n--) {
        string in;
        getline(cin, in);

        stringstream ss(in);
        string word;
        string out;
        while (ss >> word) {
            size_t pos;
            if ((pos = word.find("Hoshino", 0)) != string::npos) {
                out += word.replace(pos, 7, "Hoshina") + ' ';
            } else {
                out += word + ' ';
            }
        }
        out.erase(out.end() - 1);

        cout << out << 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];
	std::vector< std::vector<string> > str;
	str.resize(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 <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;
	bool checking  = true;
	for( j = 0; j<=n; j++)
	{
		checking = true;
		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;
							checking = check;
						} 
		 if(*(s+i) != 'H' || check  == true)
		{
			printf("%c",*(s+i));
			i++;
		}
			checking = true;
		}	
		 if(j)cout << endl;
		 if(checking == false)
			{
				cout << endl;
				checking = true;
			}
		cout << endl;
	}
	return 0;

}

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

static const std::string MISS_STR = "Hoshino";
static const std::string CORRECT_STR = "Hoshina";

int main(void) {
    int n;
    std::cin >> n;

    std::string dummy;
    std::cin.get();

    for (int i = 0; i < n; i++) {
        std::string str;
        std::getline(std::cin, str);

        std::string::size_type pos;
        while (pos = str.find(MISS_STR), pos != std::string::npos) {
            str.replace(pos, CORRECT_STR.size(), CORRECT_STR);
        }

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

    return 0;
}

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

using namespace std;

int main()
{
	int a;
	char str[100];
	char str2[100][1000];
	
	cin >> a;
	
	for(int i = 0; i < a; i++){
		fgets(str2[i],1000,stdin);
	//	scanf("%s",str2[i]);
	}
	cout << endl;
	
	for(int i = 0; i < a; i++){
		for(int j = 0; str2[i][j] != '\n'; j++){
			if(str2[i][j] == 'H' && str2[i][j+1] == 'o' && str2[i][j+2] == 's' && str2[i][j+3] == 'h' && str2[i][j+4] == 'i' && str2[i][j+5] == 'n' && str2[i][j+6] == 'o'){
				str2[i][j+6] = 'a';
			}
		}
	}
	
	for(int i = 0; i < a; i++){
		printf("%s",str2[i]);
	}
}

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

int main(){

  int n;
  string str,k;

  cin >> n;
  getline(cin,str);

  for(int i=0;i<n;i++){
    getline(cin,str);
    int s = 0;

    for(int j=0;j<str.size();j++){

      if("Hoshino" == str.substr(j,7)){
	j += 6;
		cout << "Hoshina";
      }

       else cout << str[j];

    }
    cout << endl;

  }
}

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

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  vector<string> vs;
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    string tmp;
    getline(cin, tmp);
    int j = 0;
    while ((j = tmp.find("Hoshino", j)) != string::npos) {
      tmp[j+6] = 'a';
      j += 7;
    }
    vs.push_back(tmp);
  }

  for (int i = 0; i < vs.size(); i++)
    cout << vs[i] << 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++)
		{
			if( *it == "Hoshino" )
			{
				printf("Hoshina ");
			}
			else
			{
				cout << *it << ' ';
			}
		}
		cout << endl;
	}
	return (0);
}