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

int main(){
    int line_num = 0;
    std :: string ori_sentence, new_sentence, word;
    std :: cin >> line_num;
    std :: getline(std :: cin, ori_sentence);
    for(int i = 0;i < line_num;i++){
        std :: getline(std :: cin, ori_sentence);
        std :: stringstream ss(ori_sentence);
        new_sentence = "";
        while(std :: getline(ss, word, ' ')){
            if(word == "Hoshino"){
                word = "Hoshina";
            }
            if(new_sentence != ""){
                new_sentence += (' ' + word);                
            } else {
                new_sentence += word;                
            }
        }
        std :: cout << new_sentence << std :: endl;
    }
}

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;
		u_int size;
		std::getline(std::cin, str);
		size = str.size();
		while(1){
			loc = str.find("Hoshino", loc);
			if(loc == std::string::npos || loc == size){
				break;
			}
			str[loc+6] = 'a';
			++loc;	
		}
		std::cout << str << std::endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
	char ho[8]={'H','o','s','h','i','n','o'};
	int n;
	string s;
	cin>>n;cin.ignore();
	while(n--){
		getline(cin,s);
		int a=s.length();
		rep(i,a-6){
			if(s[i]=='H'&&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';i+=6;
			}
		}
		cout<<s<<endl;
	}
}

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

int main()
{
	int n;
	char str[1000];

	scanf("%d", &n);
	for (int i = 0; i < n+1; i++) {
		fgets(str, 1000, stdin);
		str[strlen(str) - 1] = '\0';

		if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
		puts(str);
	}

	return 0;
}

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

int main () {
	int n;
	string s;
	regex r("Hoshino");
	cin >> n;
	getline(cin, s);
	while (n--) {
		getline(cin, s);
		cout << regex_replace(s, r, "Hoshina") << endl;
	}
}

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

int main(){
    int n;
    std::string str;
    std::string fr = "Hoshino";
    std::string to = "Hoshina";
    std::string::size_type pos;
    std::cin >> n;
    std::cin.get();
    
  
        //文字列の読み込み
    while(n > 0 && std::getline(std::cin, str)){
        //"Hoshino"を"Hoshina"に変換
        pos = str.find(fr);
        while(pos != std::string::npos){
            str.replace(pos, fr.size(), to);
            pos = str.find(fr, pos+to.size());
        }
        //表示
        std::cout << str << std::endl;
        str = "";
        std::cin.clear();
        --n;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  int n;
  cin >> n;
  cin.ignore();
  for(int i=0;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 <stdio.h>
#include <string>

using namespace std;

int main(){
	int n,start;
	string s;

	cin >> n;

	scanf("%*c");

	for(int i=0;i<n;i++){
		std::getline(cin,s);
		while(1){
			start = s.find("Hoshino",0);
			if(string::npos==start)break;
			s.replace(start,7,"Hoshina");
		}
		cout << s << 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(f == 0 && c == 'H')f++;
    else if(f == 1){
      if(c == 'o')f++;
      else f = -1;
    }else if(f == 2){
      if(c == 's')f++;
      else f = -1;
    }else if(f == 3){
      if(c == 'h')f++;
      else f = -1;
    }else if(f == 4){
      if(c == 'i')f++;
      else f = -1;
    }else if(f == 5){
      if(c == 'n')f++;
      else f = -1;
    }else if(f == 6){
      if(c == 'o'){
	putchar('a');
	f++;
      }
    }

    if(c == '\n'){
      n--;
      f = 0;
    }else if(c == ' ')f = 0;

    if(f==7)f = 0;
    else putchar(c);
  }
}

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

int main(){
    int n, pos;
    string str;

    cin >> n; cin.get();
    while (n--){
	getline(cin, str);
	while (pos = str.find("Hoshino"), pos!= string::npos)
	    str.replace(pos,7,"Hoshina");
	cout << str << "\n";
    }
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>
#include <numeric>
#include <sstream>

#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1;i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define PI 3.14159265358979

using namespace std;

//================================================

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int N;
	cin >> N;
	cin.ignore();

	string from = "Hoshino";
	REP(i, N) {
		string S;
		getline(cin, S);

		while(true) { 
			int res = S.find("Hoshino");
			if (res == -1) break;

			S.replace(res, 7, "Hoshina");
		}
		cout << S << "\n";
	}
	return 0;
}

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

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

	std::cin >> n;

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

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

using namespace std;

string str;
string hoshino = "Hoshino";
int hlen = hoshino.length();

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;
	
	scanf_s("%d\n", &n);
	
	for (int i = 0; i < n; i++) {
		getline(cin, str);

		changeHoshino(str.length());

		cout << str << 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::cin >> english;
		while(english.find("Hoshino") != -1){
			int find = english.find("Hoshino");
			english.replace(find, find+7, "Hoshina");
		}
		std::cout << english << std::endl;
	}
    return 0;
}

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

using namespace std;

int main(){
  int n;
  char line[1000];
  fgets(line,sizeof(line),stdin);
  sscanf(line,"%d",&n);
  char buf[1500];
  for(int i=0;i<n;i++){
    char s[1500];
    fgets(buf,sizeof(buf),stdin);
    sscanf(buf,"%[^\n]",s);
    int j=0;
    while(s[j]!='\0'){
      if(strncmp((s+j),"Hoshino",7)==0){
	s[j+6]='a';
      }
      j++;
    }
    printf("%s\n",s);
  }
  return 0;
}

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

int main() {
  string str;
  int n;
  scanf("%d\n",&n);
  for(int i=0;i<n;i++) {
    getline(cin,str);
    for(unsigned int j=0;j<str.size();j++) {
      if(str.substr(j,7) == "Hoshino") {
        str.replace(j,7,"Hoshina");
      }
    }
    cout << str << endl;
  }
}