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<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
int main(){
    int n;
    cin >> n;
    string str;
    getline(cin,str);
    rep(i,n){
        getline(cin,str);
        int k = str.size();
        rep(j,k){
            if(str[ j ] == 'H' && j+1 < k){
            if(str[j+1] == 'o' && j+2 < k){
            if(str[j+2] == 's' && j+3 < k){
            if(str[j+3] == 'h' && j+4 < k){
            if(str[j+4] == 'i' && j+5 < k){
            if(str[j+5] == 'n' && j+6 < k){
            if(str[j+6] == 'o'){ 
                str[j+6] = 'a'; 
            }}}}}}}
        }
        cout << str << endl;
    }
    return 0;
}

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

using namespace std;

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

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

int main(){
	std::string correctword = "Hoshina";

    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){
    	std::string tmp = "Hoshino";
        //std::string::size_type pos = str[i].find(tmp);
        auto pos = str[i].find(tmp);
        while(pos != std::string::npos){
        	str[i].replace(str[i].begin() + pos, str[i].begin() + pos + 7, correctword.begin(), correctword.end() );
        	pos = str[i].find(tmp, pos + 7);
        }

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

    return 0;
}

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

#define N 1000

using namespace std;

int main()
{
	int n;
	int s;
	string str;

	cin >> n;
	cin.ignore();

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

		for(s = 0; s < N-7; s++){

		if(str[s] == 'H' && str[s+1] =='o' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o' 
			|| str[s] == 'H' && str[s+1] =='a' && str[s+2] == 's' && str[s+3] == 'h' && str[s+4] == 'i' && str[s+5] == 'n' && str[s+6] == 'o'){
			
				str[s+1] = 'o';
				str[s+6] = 'a';
			}

		}
		cout << str << endl;

	}
}

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

int main() {
	int n;
	cin >> n;
	getchar();
	for (int i = 0;i < n;i++) {
		string s;
		getline(cin, s);
		int a = s.size();

		if (a >= 7) {
			for (int j = 0;j < a - 6;j++) {
				string sb;
				sb = s.substr(j, 7);
				if (sb == "Hoshino") {
					s.replace(j, 7, "Hoshina");
				}
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

int main()
{
	int n;
	char str[1024];

	cin >> n;

	for (int i = 0; i < n; i++){
		fgets(str, sizeof(str), stdin);

		int len = strlen(str);
		for (int j = 0; j < len - 6; j++){
			if (strncmp(&str[j], "Hoshino", 7) == 0){
				str[j + 6] = 'a';
			}
		}

		cout << str;
	}

	return (0);
}

C++: #include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int N;
    cin>>N;
    getchar();
    for(int i=0;i<N;i++){
        string S;
        getline(cin,S);
        while(S.find("Hoshino")!=-1){
            S.replace(S.find("Hoshino"),7,"Hoshina");
        }
        cout<<S<<endl;
    }
    return 0;
}

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

int main(void) {
  int n;
  string str;
  
  cin >> n;
  cin.ignore();
  while(n--) {
    getline(cin, str);
    for(int i=0; i<str.size()-6; i++) {
      if(str.substr(i, 7) == "Hoshino") str[i+6] = 'a';
    }
    cout << str << endl;
  }
  
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

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

C++: // 2011/01/12 Tazoe

#include <iostream>
#include <string>
using namespace std;

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

	string eng;
	getline(cin, eng);

	for(int i=0; i<n; i++){
		getline(cin, eng);
		while(true){
			string::size_type index = eng.find("Hoshino");
			if(index == string::npos)
				break;
			else
				eng.replace(index, 7, "Hoshina");
		}

		cout << eng << endl;
	}

	return 0;
}

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

int main(){
  int n;
  int i = 0;
  int flag = 0;
    std::array<std::string, 1000> str = {};

  std::cin >> n;

  while(n > 0){
    while(std::cin >> str[i]){
      ++flag;
        ++i;
    }
      for(int j = 0;j < flag;++j){
          if(str[j] == "Hoshino")
              str[j] = "Hoshina";
      }
      for(int j = 0;j < i;++j){
          std::cout << str[j];
      }
      std::cout << endl;
      
      flag = 0;
      i = 0;
      --n;
  }
}

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