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 <stdio.h>
#include <string.h>
 char x[1000];
 char *q;
    int y[1000];
    int n,i,j;
  int main(void){
   scanf("%d\n",&n);
   for(i=0;i<n;i++){
        gets(x);
        while(strstr(x,"Hoshino") != NULL){
		q=strstr(x,"Hoshino");
		q[6]='a';
		}
		puts(x);
   }
return 0;
}

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

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

int main()
{
	int N;
	string buf;
	getline(cin, buf);
	N = stoi(buf);

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

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

			}
		}
		cout << str << endl;

	}
}

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

using namespace std;

int main(){
  int n;
  scanf("%d\n", &n);
  int i;
  for(i=0;i<n;i++){
    char str[1000];
    //scanf("%[^\n]", str);
    fgets(str, 1000, stdin);
    string s(str);
    int index=0;
    while((index=s.find("Hoshino", index)) != string::npos)
      s.replace(index, 7, "Hoshina");

    printf("%s", (s.c_str()));
  }
}

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

int main(){

	const std::string correct_word = "Hoshina";
	const std::string find_word = "Hoshino";
	
	int N;

	std::cin >> N;

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

		std::string::size_type pos = str.find(find_word);
		
		while(pos != std::string::npos){

			 str.replace(pos, find_word.length(), correct_word);

			 pos = str.find(find_word, pos + find_word.length());
		}
	
		std::cout << str << std::endl;
	
	}
	return 0;
}

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

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

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

    std::string dummy;
    getline(std::cin, dummy);

    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) {
            str[pos + 6] = 'a';

            // increase cursor
            cur += (pos + MISS_STR.size() - 1);
            pos = str.find(MISS_STR, cur);
        }

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

    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main() {
    int N;
    cin >> N;
    
    string line;
    getline(cin, line);
    
    int index;

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

    return 0;
}

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

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

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

string check(string str) {
    int n;
    while((n = str.find("Hoshino")) != string::npos) {
        str[n + 6] = 'a';
    }
    return str;
}

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

    string line;
    getline(cin, line);

    for (int i = 0; i < n; i++) {
        getline(cin, line);
        cout << check(line) << endl;
    }
}

C++: #include<stdio.h>
#include<string.h>
int main(){
    char s[2000];
    int n, i, j, key = 0;
    scanf("%c", &n);
    while( n-- ) {
        gets(s);
        for ( i = 0; i < strlen(s); i++ ) {
            if ( s[i] == 'H' ) {
                if ( s[i+1] == 'o' && s[i+2] == 's' && s[i+3] == 'h' && s[i+4] == 'i' && s[i+5] == 'n' && s[i+6] == 'o') {
                    s[i+6] = 'a';
                }
            }
        }
        printf("%s\n", s);
        key++;
    }    
    return 0;
}

C++: #include<iostream>
#include<string>
int main(){
	int a;
	std::cin>>a;
	for(int i=0;i<a;i++){
		std::string str;
		std::getline(std::cin,str);
		for(int j=0;j<str.size();j++){
			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';
			}
		}
		std::cout<<str<<std::endl;
	}

	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

int main()
{
	int n;
	cin >> n;
	cin.get();
	while (n--)
	{
		string s;
		getline(cin, s);
		int i;
		while ((i = s.find("Hoshino")) != string::npos)
			s[i + 6] = 'a';
		cout << s << endl;
	}

	return 0;
}

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

int main(){
  std::string sent;
  int gyou,num;
  std::cin >> gyou;
  getline(std::cin, sent);
  for(int i=0;i<gyou;i++){
    getline(std::cin, sent);
    std::string bef="Hoshino",aft="Hoshina";
    num=sent.find(bef);
    if(num!=-1)
    sent.replace(num,bef.size(),aft);
    std::cout << sent << std::endl;
  }
  return 0; 
}

C++: #include <stdio.h>
int main(){
    int n,now;
    char a[1000],c;
    a[7]='\0';
    while(scanf("%d\n",&n)!=EOF){
        now=0;
        while(now<n){
            scanf("%s",a);
        if(a[0]=='H'&&a[1]=='o'&&a[2]=='s'&&a[3]=='h'&&a[4]=='i'&&a[5]=='n'&&a[6]=='o'&&a[7]=='\n')printf("Hoshina");
        else printf("%s",a);
        scanf("%c",&c);
        printf("%c",c);
            if(c=='\n')now++;
            a[7]='\0';
    }
    }
}

C++: #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
int n;
using namespace std;
bool is_change(string& str,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++){
			str[i] = A[j];
		}
		return true;
	}

	return false;
}
int main(){
	std::ios::sync_with_stdio(false);
	cin>>n;
	for(int i=0;i<n;i++){
		string str;
		for(int i=0;i+6<str.size();i++){
			if(change(str,i,7)){
				i+=6;
			}
		}
		cout<<str<<"\n";
	}
	return 0;
}

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

int main(){
    int n;
    string s;
    string c = "Hoshina";
    cin >> n;
    cin.ignore();
    while(n--){
        getline(cin,s);
        if(s.find("Hoshino") != string::npos){
            s.replace(s.find("Hoshino"),c.size(),c);
        }
        cout << s << endl;
    }
}