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>
#include <sstream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    cin.ignore();

    while (n--) {
        string in;
        getline(cin, in);

        stringstream ss(in);
        string word;
        string out;
        while (ss >> word) {
            if (word == "Hoshino") {
                out += "Hoshina ";
            } else {
                out += word + ' ';
            }
        }
        out.erase(out.end() - 1);

        cout << out << 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]) {
                    i += (j == 0 ? 1 : j);
                    break;
                }
            }
            if (j == (int)search.size()) {
                text[i+j-1] = 'a';
                i += j;
            }
        }
        cout << text << endl;
    }

    return 0;
}

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

int main(){
	string str;
	int n;
	cin >> n;
	getline(cin, str);
	for (int i = 0; i < n; i++) {
		getline(cin, str);
		for (int j = 0; j < str.size() - 6; j++) {
			if (str[j] == 'H') {
				if (str.substr(j + 1, 6) == "oshino")str.replace(j, 7, "Hoshina");
				else if (str.substr(j + 1, 6) == "oshina")str.replace(j, 7, "Hoshino");
			}
		}
		cout << str << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string str, judge = "";
	int n, count = -1;
	cin >> n;
	for (int i = 0; i < n; i++) {
		if (i == 0) { getline(cin, str); }
		getline(cin, str);
		for (int j = 0; j < str.size(); j++) {
			judge += str[j];
			//cout << judge << endl;
			if (str[j+1] == ' ' || j == str.size() - 1) {
				count++;
				if (judge == "Hoshino" && count == 0) {
					cout << "Hoshina";
				}
				else if (judge == " Hoshino" && count > 0) {
					cout << " Hoshina";
				}
				else {
					cout << judge;
				}
				judge = "";
			}
		}
		cout << endl;
		count = -1;
	}
	return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int main()
 {
   int n;
   cin>>n;
   getchar();
   while(n--)
   {
     string s;
     getline(cin,s);
     while(s.find("Hoshino")!=string::npos)
     {
       s.replace(s.find("Hoshino"),7,"Hoshina");                                      
     }          
     cout<<s<<endl;
   }
   //while(1);
   return 0;
 }

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<stdio.h>
using namespace std;
int main()
{
	int c,n;
	string s;
	string ho="Hoshino";
	cin >> n;
	for (int r = 0; r <= n; r++){
		s.clear();
		while ((c = getchar()) != '\n'){
			s += c;
		}
		for (int i = 0; i < s.size(); i++){
			int flag = 0;
			if (s[i] == 'H'){
				for (int i2 = 0; i2 < ho.size(); i2++){
					if (s[i + i2] != ho[i2]){
						flag = 1;
						break;
					}
				}
				if (flag == 0){
					s[i + ho.size() - 1] = 'a';
				}
			}
		}
		if (r != 0){
		cout << s << endl;
		}
	}
}

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

C++: #include<iostream>
#include<string>
using namespace std;
int main()
{
	char ch;
	int n;
	cin>>n;
	cin.get(ch);
	for(int i=0;i<n;i++)
	{
		string str;
		while(1)
		{
			cin.get(ch);
			if(ch=='\n')break;
			str+=ch;
		}
		while(1)
		{
			int idx=str.find("Hoshino");
			if(idx==-1)break;
			str[idx+6]='a';
		}
		cout<<str<<endl;
	}
	
	return 0;
}

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

int n;
char buf[1000000];

int main() {
  scanf("%d ", &n);
  while (n--) {
    fgets(buf, sizeof(buf), stdin);
    
    string ans(buf);
    while (1) {
      int pos = ans.find("Hoshino");
      if (pos == string::npos) break;
      ans = ans.replace(pos, strlen("Hoshino"), "Hoshina");
    }
    printf("%s", ans.c_str());
  }
}

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

int main(){
	long long int n;
	char* a;
	char letter[1000];
	char letter2[1000];
	memset(letter2 , 0 , sizeof(letter2));
	cin >> n;
	while(1){
		
			cin >> letter;
		
		do {
			a=strstr(letter , "Hoshino");
			if (a==NULL) break;
			strncpy(a , "Hoshina" , 7);
			
		} while (a!=NULL);
		strcat(letter2 , letter);
		strcat(letter2 , "\n");
		n--;
		if (!n) break;
	}
	cout << letter2 << endl;
	return 0;
}

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;
}