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>

int main() {

	int n;//dataset
	std::string st_1,st_2;

	st_2 = "Hoshino";

	std::cin >> n;
	std::cin.ignore();

	for (int i = 0; i < n; ++i)
	{
		getline(std::cin,st_1);

		std::string::size_type pos = st_1.find(st_2);

		while (pos != std::string::npos) {
			st_1.replace(pos, st_2.length(), "Hoshina");
			pos = st_1.find(st_2,pos+st_2.length());
		}

		std::cout << st_1 << std::endl;

	}

	return 0;
}

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

int main(){

    int data_set_num;
    std::string str;
    std::string from = "Hoshino";
    std::string to = "Hoshina";
    std::cin >> data_set_num;
    std::cin.ignore();
    //std::getline(std::cin,str);
    //sscanf(str.c_str(),"%d ",&data_set_num);

    while(data_set_num--){
        std::getline(std::cin,str);
        std::string::size_type pos = str.find(from);
        while(pos != std::string::npos){
            str.replace(pos, from.size(), to);
            pos = str.find(from, pos + to.size());
        }
        std::cout << str << std::endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  int n;
  cin >> n;
  cin.ignore();
  for(int i=0;i<n;i++){
    getline(cin,s);
    while(s.find("Hoshino")!=string::npos){
      s.replace(s.find("Hoshino"),7,"Hashino");
    }
    cout<<s<<endl;
  }
}

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,char* tmp,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++){
			tmp[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);
			char tmp[2048];
			strcpy(tmp,str.c_str());
			for(int i=0;i+6<str.size();i++){
				if(is_change(str,tmp,i,7)) i+=7;
			}

			cout << tmp << endl;
		}
	}
}

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

int main(void){
    int datanum;
    char s[1001], *p;
    
    scanf("%d", &datanum);
    fgets(s,sizeof(s),stdin); // skip \n
    for (int i=0; i<datanum; i++){
        fgets(s,sizeof(s),stdin);
        s[strlen(s)-1]='\0'; // eliminate \n
        while (p = strstr(s, "Hoshino")){
            p[6] = 'a';
        }
        printf("%s\n", s);
    }
    
    return 0;   
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
    int n,i,j;
    string str;
    cin >> n;
    for(i=0;i<n;i++){
        getline(cin,str);
        for(j=0;j<str.size();j++){
            if(j+6 > str.size()) break;
            if(str[j] == 'H' && str[j+1] == 'o' && str[j+2] == 's' && str[j+3] == 'h' && str[j+4] == 'i' && str[j+5] =='n' && str[j+6] == 'o'){
                str[j+6] = 'a';
            }
        }
        cout << str << endl;
    }
    return 0;
}

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

int main(void)
{
	int n, i;
	char a[1000][1000] = {0};
	char *p;

	while (scanf("%d\n", &n) != EOF)
	{
		for (i = 0; i < n; i++)
			gets(a[i]);
		for (i = 0; i < n; i++)
		{
			p = strstr(a[i], "Hoshino");
			if (p != NULL)
				p[6] = 'a';
		}
		
		for (i = 0; i < n; i++)
			puts(a[i]);
	}
	return 0;
}

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

using namespace std;

int main() {
  int n;
  string s1 = "Hoshino", s2 = "Hoshina";
  string::size_type pos;
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    string line;
    getline(cin, line);
    for (pos = line.find(s1); pos != string::npos; pos = line.find(s1, s2.length() + pos))
      line.replace(pos, s1.length(), s2);
    cout << line << endl;
  }

  return 0;
}

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);while(getchar()!='\n');
	rep(i,n){
		gets(s);
		p=strstr(s,"Hoshino");
		if(p!=NULL)p[6]='a';
		puts(s);
	}
	return 0;
}

C++: // include
// ----------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>

// repetition
// ----------------------------------------------------------------------------
#define FOR(i, a, b) for (i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// memory clear
// ----------------------------------------------------------------------------
#define CLRNUM(a) memset((a), 0, sizeof(a))
#define CLRBOOL(a, flag) memset((a), flag, sizeof(a))
#define CLRCHAR(a) memset((a), '\0', sizeof(a))

// debug
// ----------------------------------------------------------------------------
#define DEBUGNUM(x) printf("%d\n", x);
#define DEBUGCHAR(x) printf("%c\n", x);
#define DEBUGSTR(x) printf("%s\n", x);
#define DEBUGFORNUM(i, a, b, x) FOR(i, a, b){ printf("%d ", x[i]); }
#define DEBUGFORCHAR(i, a, b, x) FOR(i, a, b){ printf("%c ", x[i]); }
#define DEBUGREPNUM(i, n, x) REP(i, n){ printf("%d ", x[i]); }
#define DEBUGREPCHAR(i, n, x) REP(i, n){ printf("%c ", x[i]); }

// other
// ----------------------------------------------------------------------------
#define PUTNL printf("\n")

// constant
// ----------------------------------------------------------------------------
#define INF 1000000000

int main(void)
{
    int n;
    int i, j;
    char str[1024];

    scanf("%d", &n);

    CLRCHAR(str);

    getchar();
    for (i = 0; i < n; ++i){
        fgets(str, sizeof(str), stdin);
        
        for (j = 0; str[j] != '\0'; j++){
            if (str[j] == 'H'){
                if (str[j + 1] == 'o'){
                    if (str[j + 2] == 's'){
                        if (str[j + 3] == 'h'){
                            if (str[j + 4] == 'i'){
                                if (str[j + 5] == 'n'){
                                    if (str[j + 6] == 'o'){
                                        str[j + 6] = 'a';
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        
        printf("%s", str);
        
        CLRCHAR(str);
    }
    
}

C++: #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  cin.ignore();
  while(n--) {
    string s, t, u;
    getline(cin, s);
    t = "Hoshino";
    u = "Hoshina";
    for(int i = 0; i < s.size(); ++i) {
      if(s.substr(i, t.size()) == t) {
        cout << u;
        i += t.size() - 1;
      } else {
        cout << s[i];
      }
    }
    cout << endl;
  }
  return 0;
}