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<iostream>
#include<string>
#include<stdio.h>

using namespace std;

int main(){
  int num;
  char c;
  cin >> num;
  scanf("%c",&c);
  for(int i = 0; i < num; i++){
    string str;
    while(1){
      scanf("%c",&c);
      if(c == '\n'){
	if(str != "Hoshino")cout << str << endl;
	else cout << "Hoshina" <<  endl;
	break;
      }
      if(c == ' '){
	if(str != "Hoshino")cout << str << " ";
	else cout << "Hoshina ";
	str = "";
	continue;
      }
      str += c;
    }

  }
  return 0;
}

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

using namespace std;

int main()
{
	string str;
	int n,i,j;
	
	cin >> n;
	
	for(i=0;i<=n;i++)
	{
		getline(cin,str);
		
		if(i!=0)
		{
			for(;;)
			{
				if(str.find("Hoshino")<str.size())
					str[str.find("Hoshino")+6]='a';
				else
					break;
			}
			cout << str << endl;
		}
	}
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int n;
	char s[1001];
	char *p;
	scanf("%d",&n);
	rep(i,n){
		gets(s);
		p=strstr(s,"Hoshino");
		if(p!=NULL)p[6]='a';
		puts(s);
	}
	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'; 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++;
        }
    }
}