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>

int main(){
  u_int max_line;
  const std::string before("Hoshino");
  const std::string after("Hoshina");
  std::cin >> max_line;
  std::cin.ignore();
  for(int i = 0; i < max_line; ++i){
    std::string str;
    std::getline(std::cin,str);
    auto pos = str.find(before);
    while(pos != std::string::npos){
      str.replace(pos, before.length(), after);
      pos = str.find(before);
    }
    std::cout << str << std::endl;
  }
  return 0;
}

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



int main(){
	std::string str;
	int data_num;
	std::cin >> data_num;
	std::cin.ignore();
	for(int i = 0; i < data_num; ++i){
		u_int loc = 0;
		std::getline(std::cin, str);
		while(1){
			loc = str.find("Hoshino", loc);
			if(loc == std::string::npos){
				break;
			}
			str[loc+6] = 'a';	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

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

int main(){
	long double n;
	string spot;
	cin>>n;
	cin.ignore();
	for(long i=0;i<n;i++){
		getline(cin,spot);
		for(long j=0;j<=spot.size()-7;j++){
			string str="";
			for(long k=j;k<j+7;k++){
				str+=spot[k];
			}
			if(str=="Hoshino"){
				spot[j+6]='a';
			}
		}
		cout<<spot<<'\0'<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
#include <string.h>

#define X first
#define Y second
#define MP make_pair
typedef long long ll;
using namespace std;
const int MAX = 101;

template<class T, class U>
void convert(T &t, U &u){
	stringstream ss;
	ss << t;
	ss >> u;
}

int main(){
	int n;
	cin >> n;
	cin.ignore();
	while(n--){
		string s;
		getline(cin, s);
		for(int i = 0; i < s.size(); i++){
			int res = s.find("Hoshino", i);
			if(res == -1) break;
			s.replace(res, 7, "Hoshina");
			i = res+7;
		}
		cout << s << endl;
	}
	return 0;
}

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

int main(){
	long double n;
	string spot;
	cin>>n;
	cin.ignore();
	for(int i=0;i<n;i++){
		getline(cin,spot);
		for(int j=0;j<spot.size()-6;j++){
			string str="";
			for(int k=j;k<j+7;k++){
				str+=spot[k];
			}
			if(str=="Hoshino"){
				spot[j+6]='a';
			}
		}
		cout<<spot<<endl;
	}
	return 0;
}

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

int main(void){

	int i,j,n;
	char *p;
	char a[1000];
	scanf("%d\n",&n);
	for(i = 0;i < n;i++){
        fgets(a,sizeof(a),stdin);
        while((p = strstr(a,"hoshino"))!=NULL){
            p[6] = 'a';
        }
                printf("%s\n",&a[i]);

    }


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;
        
        while((index = text.find(str_false, index)) != string::npos)
            text.replace(index, str_false.size(), str_true);
        std::cout  << text << std::endl;
    }
    
    return 0;
}

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

int main()
{
	int WordQuantity = 0,totalcnt = 0,alf = 0;
	char Hoshino[8] = {"Hoshino"};
	char Hoshina[8] = {"Hoshina"};
	int n;

	scanf("%d",&n);
	fflush(stdin);

	for(int loop = 0; loop < n; loop++){
		char words[500][1001];
		char text[1001];
		totalcnt = 0;

		gets(text);
		fflush(stdin);

		for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
			for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
				words[WordQuantity][alf] = text[totalcnt];
				totalcnt++;
			}
			words[WordQuantity][alf] = '\0';
			totalcnt++;
		}

		for(int i = 0; i < WordQuantity; i++){
			if(strcmp(words[i],Hoshino) == 0){
				strcpy(words[i],Hoshina);
			}
		}

		for(int i = 0; i < WordQuantity-1; i++){
			printf("%s ",words[i]);
		}
		printf("%s\n",words[WordQuantity-1]);

	}

	return 0;
}

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

int main()
{
	int n;

	cin >> n;
	cin.clear();
	cin.ignore( 1, '\n' );

	for( int i = 0; i < n; ++i ){
		string s;
		getline( cin, s );
		int index = 0;
		while( ( index = s.find( "Hoshino", index ) ) != string::npos ){
			s.replace( index, strlen("Hoshino"), "Hoshina" );
			index += strlen("Hoshina");
		}
		cout << s << endl;
	}

	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <ctime>
#include <climits>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <tuple>
#include <bitset>
#include <unordered_map>

using namespace std;

int main() {
    const string search = "Hoshino";

    int n;
    cin >> n;
    cin.get();

    string text;
    while (n --) {
        getline(cin, text);
        for (int i=0; i<(int)text.size(); ) {
            int j;
            for (j=0; j<(int)search.size(); ++j) {
                if ((int)text.size() < i+j || search[j] != text[i+j]) {
                    break;
                }
            }
            if (j == (int)search.size()) {
                text[i+j-1] = 'a';
            }
            i += j;
        }
        cout << text << endl;
    }

    return 0;
}

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

using namespace std;

char str[1001];
char hoshino[] = "Hoshino";
int hlen = strlen(hoshino);

void changeHoshino(int len) {
	for (int i = 0; i <= len - hlen; i++) {
		int j = 0;
		while ((j < hlen) && (str[i+j] == hoshino[j]))
			j++;

		if (j == hlen)
			str[i+j-1] = 'a';
	}
}
int main() {
	int n;

	cin >> n;
	
	fgets(str, 1001, stdin);
	for (int i = 0; i < n; i++) {
		fgets(str, 1001, stdin);

		changeHoshino(strlen(str));

		cout << str;
	}

	return 0;
}

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

int main()
{
    int n;
    cin >> n;
    for(int j=0;j<n;j++)
    {
        string ss;
        getline(cin,ss);
        int len =ss.size();
        for(int i=0;i<1001;i++)
        {
            cout << ss[i];
            if(ss[i]=='H')
            {
                if(ss.substr(i,7)=="Hoshino")
                {
                    ss[i+6]='a';
                    i += 6;
                }
            }
            if(ss[i]=='\0')break;
        }

        for(int i=0;i<len;i++){
            if(ss[i]=='\0')break;
            cout <<ss[i];
        }
        cout << endl;
    }
    return 0;
}

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

int main(){
    int n; //dataset number
    std::string before = "Hoshino";
    std::string after = "Hoshina";

    std::cin >> n;
    std::cin.ignore();
    
    for(int i = 0; i < n; ++i){
        std::string str;
        std::getline(std::cin, str);
        std::string::size_type pos = str.find(before);
        while(pos != std::string::npos){
            str.replace(pos, before.size(), after);
            pos = str.find(before, pos + after.size());
        }
	std::cout << str << std::endl;

    }
    return 0;
}

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

int main(){
	int n;
	std::string str;

	std::cin >> n;
	std::getline(std::cin, str);

	for (int i = 0; i < n; ++i){

		std::getline(std::cin, str);

		while(str.find("Hoshino") != std::string::npos){

			str.replace(str.find("Hoshino"), 7, "Hoshina");

		}

		std::cout << str << std::endl;
		
	}

	return 0;
}