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 <sstream>
#include <iostream>
#include <array>

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i <= line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

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

int main(){
	int n; // the number of datasets
	std::cin >> n;

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

		int text_size = text.size();
		int moji = 0;
		while(moji < text_size){
			moji = text.find("Hoshino", moji);
			text.replace(moji, 7, "Hoshina");
		}
		
		std::cout << text << std::endl; //output
	}

	return 0;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <complex>
#include <sstream>
#include <stack>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> Point;

typedef map<int, pair<int, long long> > mipill;

int main()
{
	int n;
	scanf("%d%*c", &n);
	
	rep(i, n){
		char s[1024];
		fgets(s, 1024, stdin);
		s[strlen(s)-1] = '\0';
		
		string str(s);
		string::size_type index = 0;
		while((index = str.find("Hoshino", index)) != string::npos)
			str[index + 6] = 'a';

		puts(str.c_str());
	}
	return 0;
}

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


int main(void){

	int i,n;
	char *p;
	char a[1002];
	char word[]="Hoshino";
	scanf("%d\n",&n);
	for(i = 0;i < n;i++){
        fgets(a,sizeof(a),stdin);
        while((p = strstr(a,word))!=NULL){
            p[6] = 'a';
        }
                printf("%s",a);

    }


return 0;
}

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

using namespace std;
int main(){
	int n,i,j,h;
	char *p;
	char buf[1100];
	string str;
	string hit="Hoshino";
	string word="Hoshina";
	cin>>n;
	string tmp;
	getline(cin,tmp);
	for(;true;){
		string buf;
		getline(cin,buf);
		if(buf.size()==0)break;

		stringstream ss(buf);
//		cout<<"word :"<<buf<<endl;
		for(int i=0;ss >> str;i++){
			if(i)cout<<" ";
			h=str.size();
			int st=str.find(hit);
			if(st>=0)str.replace(st,word.size(),word);
			cout<<str;
		}
		cout<<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,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++){
			str[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 idx=0;idx<n;idx++){
			getline(cin,str);
			for(int i=0;i+6<str.size();i++){
				if(is_change(str,i,7)) i+=6;
			}

			cout << str << endl;
		}
	}
}

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

using namespace std;

void solve()
{
	int n;
	cin >> n;
	while(n--)
	{
		string str;
		getline(cin, str);
		for(int i = 0; i < str.size(); ++i)
		{
			if(str[i] == 'H' && i + 6 < str.size() && 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';
				i += 6;
			}
		}
		cout << str << endl;
	}
}

int main()
{
	solve();
	return(0);
}

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

void strReplace(string& str, const string& from, const string& to){
	string::size_type pos = 0;
	while(pos = str.find(from, pos), pos != string::npos){
		str.replace(pos, from.length(), to);
		pos += to.length();
	}
}

int main(){
	cin >> n;
	cin.clear();
	cin.ignore();
	for(int i = 0; i < n; i++){
		string s;
		getline(cin, s);
		strReplace(s, "Hoshino","Hoshina");
		cout << s << endl;
	}
}

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

static void inputSentences(std::vector<std::string>& sentences, int n)
{
  fflush(stdin);
  for (int i = 0; i < n; i++) {
    std::string inputSentence;
    getline(std::cin, inputSentence);
    sentences.push_back(inputSentence);
  }
}

static void convertSentences(std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    while (true) {
      int find = it->find("Hoshino");
      if (find == std::string::npos) {
        break;
      }
      it->at(find + 6) = 'a';
    }
  }
}

static void outputSentences(std::vector<std::string>& sentences)
{
  for (std::vector<std::string>::iterator it = sentences.begin();
    it != sentences.end();
    ++it) {
    std::cout << *it << std::endl;
  }
}

int main(void)
{
  int n;
  std::vector<std::string> sentences;

  std::cin >> n;

  inputSentences(sentences, n);
  convertSentences(sentences);
  outputSentences(sentences);

  return 0;
}

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

int main(void) {
	int i,j;
	int n = 0;
	char strsent[50][1000] = { 0 };
	char work[1000] = { 0 };
	scanf("%d", &n);
	getchar();
	for(i = 0; i < n; i++) {
		// ???????????\???
		gets(strsent[i]);
	}
	for(i = 0; i < n; i++) {
		for(j = 0; strsent[i][j] != '\0'; j++){
			// null?????§??????
			if(	strsent[i][j+1] == '\0' ||
				strsent[i][j+2] == '\0' ||
				strsent[i][j+3] == '\0' ||
				strsent[i][j+4] == '\0' ||
				strsent[i][j+5] == '\0' ||
				strsent[i][j+6] == '\0' ) {
				// ???????????????????????°?????????????????§??????
				break;
			}
			if(	strsent[i][j]   == 'H' &&
				strsent[i][j+1] == 'o' &&
				strsent[i][j+2] == 's' &&
				strsent[i][j+3] == 'h' &&
				strsent[i][j+4] == 'i' &&
				strsent[i][j+5] == 'n' &&
				strsent[i][j+6] == 'o' ) {
				// Hoshino?????´??????Hoshina????¨???£
				strsent[i][j+6] = 'a';
			}
		}
		printf("%s\n", strsent[i]);
	}
	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>
using namespace std;

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

  	getline(cin, A);
  	while(n--) {
  		
    getline(cin, A);
    for(int i=0;i<(int) A.size()-6;i++) {
    	
    if(A.substr(i,7) == "Hoshino")
    A.replace(i, 7, "Hoshina");

    }
    cout <<A << "\n";
  }
  	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	string s;
	int n;
	cin>>n;
	cin.ignore();
	for(int i=0;i<n;i++){
		getline(cin,s);
		while(1){
			if(s.find("Hoshina")==string::npos) break;
			s.replace(s.find("Hoshina"),7,"Hashino");
			}
		cout<<s<<endl;
		}
}