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

int main(){
  int n;
  char c;
  int f;

  cin >> n;
  getchar();

  f = 0;
  while(n){
    c = getchar();
    if(c == '\n')n--;
    if(f == 0 && c == 'H')f++;
    else if(f == 1){
      if(c == 'o')f++;
      else f = 0;
    }else if(f == 2){
      if(c == 's')f++;
      else f = 0;
    }else if(f == 3){
      if(c == 'h')f++;
      else f = 0;
    }else if(f == 4){
      if(c == 'i')f++;
      else f = 0;
    }else if(f == 5){
      if(c == 'n')f++;
      else f = 0;
    }else if(f == 6){
      if(c == 'o')c = 'a';
      f = 0;
    }

    putchar(c);
  }
}

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

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

	scanf("%d ", &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 <iostream>
#include <string>

using namespace std;

const string src = "Hoshino";
bool check(string str,int n,int m){
    if(str[n]==src[m]){
        if(m==6) return true;
        return check(str,n+1,m+1);
    }
        return false;
}
int main(){
    int n;
    cin >> n;
    string *str=new string[n];
    for(int i=0;i<n+1;i++){
        getline(cin,str[i]);
        for(int j=0;j<str[i].size();j++){
            if(check(str[i],j,0)){
                str[i][j+6]='a';
            }
        }
    }
    for(int i=0;i<n+1;i++){
        cout << str[i];
        if(i) cout << endl;
    }
}

C++: #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
	int n;
	cin >> n;
	char *ho = "Hoshino";
	rep(i,n+1) {
		char c, s[2010];
		rep(j, 2000) {
			scanf("%c", &c);
			if(c == '\n') {
				s[j] = '\0';
				break;
			} else {
				s[j] = c;
			}
		}
		for(int j = 0; s[j] != '\0'; ++j) {
			int f = 1;
			rep(k,7) {
				if(s[j + k] != ho[k]) {
					f = 0;
					break;
				}
			}
			if(f) s[j + 6] = 'a';
		}
		printf("%s",s);
		cout << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string str;vector<string> vs;
    vs.clear();
    while(cin>>str){
      if(str=="Hoshino"){
	vs.push_back("Hoshina");
      }else
	vs.push_back(str);
    }
    for(int j=0;j<vs.size();j++){
      cout<<vs[j];
      if(j!=vs.size()-1)
	cout<<" ";
    }
    cout<<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 != n && j != 0)
            cout << endl;
        
    }
    cout << 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;
        }*/
        if(j != 0)cout << endl;
    }
    return 0;
    
}

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

int main(void){
	int n,i,j;
	char a[55];
	cin >> n;
	getchar();
	for(j=0; j<n; j++){
		i = 0;
		while(true){
			a[i] = getchar();
			if(a[i]=='\n'){
				putchar('\n');
				break;
			}else if(a[i]=='o' && i > 6){
				if(a[i-6] == 'H' && a[i-5] == 'o' && a[i-4] == 's' && a[i-3] == 'h' && a[i-2] == 'i' && a[i-1] == 'n'){
					putchar('a');
				}else{
					putchar(a[i]);
				}
			}else{
				putchar(a[i]);
			}
			i++;
		}
	}
	return 0;
}

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

int main()
{
    const std::string str_false = "con";
    const std::string str_true = "Hoshina";

    u_int num_of_data;
    std::cin >> num_of_data;
    std::cin.ignore();
    
    for(u_int i = 0; i < num_of_data; ++i){
        std::string text;
        getline(std::cin, text);
        
        std::string::size_type index = 0;
        while((index = text.find(str_false, index)) != std::string::npos){
            text.replace(index, str_false.size(), str_true);
            index += str_true.size();
        }
        std::cout  << text << std::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);
        int index;
        
        while((index = text.find(str_false, index)) != (int)std::string::npos)
            text.replace(index, str_false.size(), str_true);
        std::cout  << text << std::endl;
    }
    
    return 0;
}

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

using namespace std;

int main()
{
   string str;

   getline( cin, str);

   while( string::npos != str.find( "Hoshino"))
   {
      int pnt = str.find( "Hoshino" );
      
      str.replace( pnt, 7, "Hoshina");
   }

   cout << str << endl;
}