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 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'; i+=7; }
    }
    cout << str << endl;
  }
  
  return 0;
}

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

using namespace std;

int main(){
	string s;
	int n;
	int c_pos;
	cin>>n;
	cin.ignore();
	while(n--){
		getline(cin,s);
		while((c_pos=s.find("Hoshino"))!=string::npos){
			s.replace(c_pos,7,"Hashina");
		}
		cout<<s<<endl;
	}
	
}

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

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

  cin >> n;
  //  cin.ignore();                                                             
  for (int i = 0; i < n ; ++i){
    getline(cin, s);
    while(1){
      pos = s.find("Hoshino");
      if(pos == -1) break;
      s[pos+6] = 'a';
    }
    cout << s << '\n';
  }
  return 0;

C++: #include <iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cin.ignore();
  string line;
  string s = "Hoshina";
  while(getline(cin, line))
 {
    while(line.find("Hoshino")!=string::npos)
      {
      line.replace(line.find("Hoshino"), s.size(), s);
    }
    cout<<line<<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 = 0;
        
        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 <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    string s;
    for (int i=0;i<=n;i++) {
        getline(cin,s);
        if (s!="") {
            for (int i=0;i<s.size();i++) {
                if (s[i]=='H') {
                    if (i+6<s.size()) {
                        if (s[i+1]=='o'&&s[i+2]=='s'&&s[i+3]=='h'&&s[i+4]=='i'&&s[i+5]=='n'&&s[i+6]=='o') {
                            cout<<"Hoshina";
                            i+=6;
                        } else {
                            cout<<s[i];
                        }
                    } else {
                        cout<<s[i];
                    }
                } else {
                    cout<<s[i];
                }
            }
            cout<<endl;
        }
    }
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int n;
	string s;
	string d="Hoshina";
	cin>>n;
	getline(cin,s);
	while(n--){
		getline(cin,s);
		while(1){
			unsigned int loc = s.find("Hoshino");
			if(loc!=string::npos)
			s.replace(loc,d.size(),d);
			else
				break;
		}
		cout<<s<<endl;
	}
	
}

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

using namespace std;

int main(void){

  int n,N;
  string s;
  cin >> n;
  cin.ignore(); //無視

  while(n--){

    getline( cin , s );

    while( s.find("Hoshino",0 ) != string::npos ){
       N = s.find("Hoshino" , 0 ); 
      // 0文字目から文字を探す
      s.replace( N , 7 , "Hoshina");
      // 変数名.replace(最初(位置),文字数,文字列)
    }
    cout << s << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
 
int main(void){
    int n; //number of data set
 
    std::cin >> n; //input number of data set
    std::cin.ignore(); //delete cin buffer
 
    for(size_t i = 0; i < n; ++i){
        std::vector<std::string> str; //string data
        std::string line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}

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

int main(){
  std::string sent;
  int gyou,num=0;
  std::cin >> gyou;
  getline(std::cin, sent);
  for(int i=0;i<gyou;++i){
    num=0;
    getline(std::cin, sent);
    std::string bef="Hoshino",aft="Hoshina";
    while(num!=-1){
      num=(int)(sent.find(bef));
      if(num!=-1){
      sent.replace(num,bef.size(),aft);
      }
    }
    std::cout << sent << std::endl;
  }
  return 0; 
}

C++: #include <stdio.h>
int main(){
    int n,now;
    char c;
    while(scanf("%d\n",&n)!=EOF){
        now=0;
        while(now<n){
            scanf("%c",&c);
            if(c=='H'){
                scanf("%c",&c);
                if(c=='o'){
                    scanf("%c",&c);
                    if(c=='s'){
                        scanf("%c",&c);
                        if(c=='h'){
                            scanf("%c",&c);
                            if(c=='i'){
                                scanf("%c",&c);
                                if(c=='n'){
                                    scanf("%c",&c);
                                    if(c=='o'){
                                        printf("Hoshina");
                                    }
                                    else printf("Hoshin%c",c);
                                }
                                else printf("Hoshi%c",c);
                            }
                            else printf("Hosh%c",c);
                        }
                        else printf("Hos%c",c);
                    }
                    else printf("Ho%c",c);
                }
                else printf("H%c",c);
            }
            else printf("%c",c);
            if(c=='\n')now++;
        }
    }
}

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

void Hoshina(string& str){
	if(str.size() < 7){
	} else {
		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 <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

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