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 data;
	std::cin >> data;  //dataset
	std::cin.ignore();
	
	std::string mis = "Hoshino";
	std::string correct = "Hoshina";
	
	for(int i=0; i<data; ++i){
		std::string  sentence;
		
		std::getline(std::cin, sentence);
		
		std::string::size_type index = sentence.find(mis);
		
		if(index == std::string::npos){
			std::cout << sentence << std::endl;
		}else{
			while(index != std::string::npos){
				sentence.replace(index, mis.length(), correct);
				index = sentence.find(mis, index + correct.length());
			}
			std::cout << sentence << std::endl;
		}
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int ct;
	char *rp;
	char retu[1000],s[]="Hoshina";
	scanf("%d",&ct);
	fflush(stdin);
	for(int f1=0;f1<ct;f1++){
		gets(retu);
		while(1){
			if(strstr(retu,"Hoshino")==NULL){
				break;
			}
			if(rp=strstr(retu,"Hoshino")){
				rp+=6;
				*rp='a';
			}
		}
		printf("%s\n",retu);
	}
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int main(){
int counter;
string n;
string hoshino="Hoshino";
cin>>counter;
cin.ignore();
for(int iii=0;iii<counter;iii++){
	getline(cin,n);
	string tmp="";
	for(int i=0;i<=max( 0,(int)n.size()-7 );i++){
		bool f=1;
		int cnt=0;
		for(int j=i;j<i+7;j++)if(n[j]!=hoshino[j-i])f=0;
		if(f)n[i+6]='a';
	}//endfor
	cout<<n<<endl;
}

	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int compare(const std::string& buf, const std::string& str)
{
}

int main(int argc, char const *argv[])
{
	int n;
	std::string str1 = "Hoshino";
	std::string str2 = "Hoshina";
	int len = 7;
	std::string s;
	std::getline(std::cin, s);
	std::stringstream ss(s);
	ss >> n;
	REP(i, n)
	{
		std::getline(std::cin, s);
		int k = 0;
		int l = s.length();
		while(k+7 <= l)
		{
			int n = 0;
			for (int j = 0; j < 7; j++)
			{
				if (s[k+j] != str1[j])
				{
					n = j+1;
					break;
				}
			}
			if (n == 0)
			{
				s[k + 6] = 'a';
				n = 7;
			}
			k += n;
		}
		std::cout << s << std::endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
 
int main()
{
    string str;
    int n;
     
    cin >> n;
    getline(cin, str);
    while (n--) {
        getline(cin, str);
        for (int j = 0; j <= (int)str.size()-7; j++) {
            string key = str.substr(j, 7), repl;
            if (key == "Hoshino") {
                repl = "Hoshina";
                for (int k = 0; k < n; k++) {
                    str[j+k] = repl[k];
                }
            }
        }
        cout << str << endl;
    }
    return 0;
}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>


using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    cin.ignore(); // or use cin.get(); ignore() can be used as when you want to input data and segment them by "enter key", if no "ignore()", then it can be seen as the whole data
    
    string str;
    
    while (n--)
    {
        getline(cin, str);
        
        for (int i = 0; i < (int)str.size(); i ++ ) //because size() returned "unsigned int" type, so need to cast to "int"
        {
            if ("Hoshino" == str.substr(i, 7))
            {
                i += 6;
                cout<<"Hoshina";
            }
            else
            {
                cout<<str[i];
            }
        }
        
        cout<<endl;
    }
    
}

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

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

static const std::string MISS_STR = "Hoshino";
static const std::string CORRECT_STR = "Hoshina";

int main(void) {
    int n;
    std::cin >> n;
    getchar();

    while (0 < n--) {
        std::string str;
        std::getline(std::cin, str);

        const unsigned int str_size = str.size();
        unsigned int cur = 0;
        std::string::size_type pos = str.find(MISS_STR, 0);

        while (pos != std::string::npos && cur <= str_size) {
            // fix miss
            for (unsigned int i = cur; i < pos; i++) {
                std::cout << str.at(i);
            }
            std::cout << CORRECT_STR;

            // increase cursor
            cur += (pos + MISS_STR.size());

            pos = str.find(MISS_STR, cur);
        }

        for (unsigned int i = cur; i < str_size; i++) {
            std::cout << str.at(i);
        }
        std::cout << 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";
    cin >> data_set_num;
    //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 <iostream>
#include <cstdio>
using namespace std;

string str;
int n;


string solve(string str){
        for(int i=0;i<str.size()-6;i++){
                if(str[i]=='H')
                        if(str[i+1]=='o')
                                if(str[i+2]=='s')
                                        if(str[i+3]=='h')
                                                if(str[i+4]=='i')
                                                        if(str[i+5]=='n')
                                                                if(str[i+6]=='o')
                                                                        str[i+6]='a';
        }
return str;
}

int main(){
        scanf("%d\n", &n);
        for(int i=0;i<n;i++){
                getline(cin, str);
                cout << solve(str) << endl;
        }
}