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>

using namespace std;

void solve()
{
	int n;
	scanf("%d\n", &n);
	string name = "Hoshino";
	while(n--)
	{
		string s;
		getline(cin, s);
		for(int i = 0; i < s.length() - name.length() + 1; ++i)
		{
			bool flag = true;
			for(int j = 0; j < name.length(); ++j)
			{
				if(s[i + j] != name[j])
				{
					flag = false;
					break;
				}
			}
			if(flag)
			{
				s[i + name.length() - 1] = 'a';
			}
			else
			{
				continue;
			}
		}
		cout << s << endl;
	}
}

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

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

std::string replaceWord(const std::string wrong_word, const std::string right_word, std::string str){
	
	std::string::size_type pos = str.find(wrong_word);
	
    while(pos != std::string::npos){
        str.replace(pos, wrong_word.length(), right_word);
        pos = str.find(wrong_word);
    }
	
	return str;
}

int main(){
    std::string w_word("Hoshino");
    std::string r_word("Hoshina");
	
    int num;
    std::cin >> num;
    std::cin.ignore();
      
    for(int i = 0; i < num; ++i){
        std::string str;
        std::getline(std::cin, str);
        std::cout << replaceWord(w_word, r_word, str) << std::endl;
    }
	
    return 0;
}

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

using namespace std;

int main() {
	int n; scanf("%d\n", &n);
	for (int i = 0; i < n; ++i) {
		string str = "";
		while (1) {
			char c;
			if (scanf("%c", &c) == EOF) c = '\n';
			if (c == ' ' || c == '\n') {
				if (str == "Hoshino") cout << "Hoshina";
				else cout << str;
				cout << c;

				str = "";

				if (c == '\n') break;
			}
			else str += c;
		}
	}
}

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

using namespace std;

int main() {
  int n;
  string str;
  getline(cin, str);
  n = atoi(str.c_str());

  for (int i = 0; i < n; ++i) {
    string str;
    getline(cin, str);

    int pos = -1;
    while (pos = str.find("Hoshino", pos + 1), pos != string::npos)
      str.replace(pos, 7, "Hoshina");
    cout << str << endl;
  }
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
 
int main(void){
  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 <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

vector<string> split(const string& input)
{
	istringstream stream(input);

	string field;
	vector<string> result;
	while( std::getline(stream, field, ' ') )
	{
		result.push_back(field);
	}
	return result;
}

int main()
{
	int n;

	scanf("%d\n", &n);
	loop(i, 0, n)
	{
		string line;
		std::getline(cin, line);
		
		vector<string> words = split(line);
		for(vector<string>::iterator it = words.begin(); it != words.end(); it++)
		{
			string showStr = *it;
			int findPos = showStr.find("Hoshino");

			if( findPos != string::npos && findPos == 0 && !isalpha(showStr.substr(7).data()[0]))
			{
				showStr.replace(findPos, 7, "Hoshina");
			}
			printf("%s ", showStr.c_str());
		}
		cout << endl;
	}
	return (0);
}

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

int main(){
	int n;
	std::cin >> n;
	std::cin.ignore();
	
	while(n--){
		std::string Eng;
		getline(std::cin, Eng);
		std::string::size_type pos;
		while((pos = Eng.find("Hoshino")) != std::string::npos){
			Eng.replace(pos, 7, "Hoshina");
		}
		std::cout << Eng << std::endl;
	}
	
    return 0;
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char a[1050]={0};
        fflush(stdin);
        scanf("%[^\n]",a);
        fflush(stdin);
        for(j=0;j<strlen(a);j++)
        {
            if(a[j]=='H'&&a[j+1]=='o'&&a[j+2]=='s'&&a[j+3]=='h'&&a[j+4]=='i'&&a[j+5]=='n'&&a[j+6]=='o')
            {
                a[j+6]='a';
            }
        }
        printf("%s\n",a);
        //for(j = 0; j < 1050; j++)a[j]=0;
        fflush(stdin);
    }
    return 0;
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int i,j,n;
    scanf("%d",&n);
    getchar();
    for(i=0;i<n;i++)
    {
        char a[1050]={0};
        //fflush(stdin);
        getchar();
        scanf("%[^\n]",a);
        for(j=0;j<strlen(a);j++)
        {
            if(a[j]=='H'&&a[j+1]=='o'&&a[j+2]=='s'&&a[j+3]=='h'&&a[j+4]=='i'&&a[j+5]=='n'&&a[j+6]=='o')
            {
                a[j+6]='a';
            }
        }
        printf("%s\n",a);
        //for(j = 0; j < 1050; j++)a[j]=0;
    }
    return 0;
}

C++: 
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	int n;
	cin >> n;
	string sub;
	for (int i = 0; i < n; ++i) {
		string s;
		getline(cin, s);
		for (int j = 0; j < s.size(); ++j) {
			if (s.size() < 7) {
				break;
			}
			sub = s.substr(j, 7);
			if (sub == "Hoshino") {
				s.replace(j, 7, "Hoshina");
			}
		}
		cout << s << endl;
	}
	return 0;
}

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

int n;
string A;
 
int main(){
	 
  	cin>>n;

  	getline(cin, A);
  	while(n--) {
  		
    getline(cin, A);
    for(int i=0;i<A.length()-6;i++) {
    	
    if(A.substr(i,7) == "Hoshino")
    A.replace(i, 7, "Hoshina");

    }
    cout<<A<<endl;
  }
  	return 0;
}

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

int main()
{
    int n;
    cin>>n;
    getchar();
    while(n!=0){
        string str;
        getline(cin,str);
        for(int i=0;i<str.length();i++){
            if(str[i]=='H' && str[i+1]=='o' && str[i+2]=='s' && str[i+3]=='h' && str[i+4]=='i' && str[i+5]=='n' && str[i+6]=='o'){
                str[i+6]='a';
                i += 6;
            }
        }
        cout<<str<<endl;
        n--;
    }
    return 0;
}

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

void ReplaceAll(string& s, string from, string to){
  string::size_type p = 0;
  while(p=s.find(from,p), p!=string::npos){
    s.replace(p, from.length(), to);
    p += to.length();
  }
}

int main(void){
  int n;
  string x;
  char tmp[1024];

  cin>>n;
  cin.get();
  while(n--){
    cin.getline(tmp,1024);
    x = tmp;
    ReplaceAll(x,"Hoshino","Hoshina");
    cout<<x<<endl;
  }

  return 0;
}

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

int main(){
	int num;
	std::string english;
	std::cin >> num;
	for(int i=0;i<=num;++i){
		std::getline(std::cin,english);
		
		while(english.find("Hoshino") != -1){
			size_t find = english.find("Hoshino");
			english.replace(find, find+7, "Hoshina");
		}

		std::cout << english << std::endl;
	}
    return 0;
}