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>
using namespace std;

int main()
{
	int n,p;
	string s;
	cin >> n;
	while(n--)
	{
		if(cin.peek()=='\n') cin.ignore();
		getline(cin,s);
		while(p=s.find("Hoshino"), p!=-1)
		{
			s.replace(p,7,"Hoshina");
		}
		cout << s << endl;
	}
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define REP(i,e) for (int i = 0; i != int(e); i++)
#define FORIT(i, A) for (auto i : A)
#define ISEQ(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << endl
#define SZ(x) ((int)(x).size())

int compare(const std::string& buf, const std::string& str)
{
	int l2 = str.length();
	int l1 = buf.length();
	for (int i = 0; i < l1 && i < l2; i++)
	{
		if (buf[i] == str[i])
		{
			continue;
		}
		return i+1;
	}
	return 0;
}

int main(int argc, char const *argv[])
{
	int n;
	std::string str1 = "Hoshino";
	std::string str2 = "Hoshina";
	int len = str1.length();
	scanf("%d\n", &n);
	REP(i, n)
	{
		std::string s;
		std::getline(std::cin, s);
		int k = 0;
		int l = s.length();
		while(k < l)
		{
			int ret = compare(s.substr(k), str1);
			if (ret == 0)
			{
				s[k + 6] = 'a';
				ret = len;
			}
			k += ret;
		}
		std::cout << s << std::endl;
	}
	return 0;
}

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++) {
		gets(str);

		if(strstr(str, "Hoshino") != NULL) str[(strstr(str, "Hoshino") - str) + 6] = 'a';
		printf("%s\n", str);
	}

	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
  int n;
  cin >>n;
  cin.ignore();
  while(n--){
    string s;
    getline(cin,s);
    for(;;){
      string::size_type x = s.find("Hoshino");
      if(x == string::npos){break;}
      s[x+6] = 'a';
    }
    cout <<s<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main()
{
  int n;
  string line;
  cin >> n;
  getline(cin, line);
  while(n--){
    int p;
    getline(cin, line);
    while((p = line.find("Hoshino")) != -1){
      line[p+6] = 'a';
    }
    cout << line << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main(){
  int n, i, s, g;
  string a;
  cin>>n;
  for(g=0; g < n;g++){
      getline(cin,a);
      if(a==""){
        g--; 
        continue;
      }
      for(i=6; i <= a.size();i++)
      if(a[i-6]== 'H' &&a[i-5]== 'o' &&a[i-4]== 's' &&a[i-3]== 'h' &&a[i-2]== 'i' &&a[i-1]== 'n' &&a[i]== 'o')
      a[i]='a';   
      cout<<a<<endl;
  } 
  return 0; 
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int ct,len;
	char *rp;
	char retu[1000],s[]="Hoshina";
	scanf("%d",&ct);
	fflush(stdin);
	for(int f1=0;f1<ct;f1++){
		gets(retu);
		if(rp=strstr(retu,"Hoshino")){
			rp+=6;
			*rp='a';
		}
		printf("%s\n",retu);
	}
	return 0;
}

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

int main(){
	int n; // the number of datasets
	std::cin >> n;
	std::cin.ignore();

	for(int i = 0; i < n; ++i){
		std::string text;
		std::getline(std::cin, text); // input
		
		int text_size = text.size();
		int moji = text.find("Hoshino");
		while(moji != basic_string::npos){
			text.replace(moji, 7, "Hoshina");
			moji = text.find("Hoshino", moji);
		}
		
		std::cout << text << std::endl; //output
	}

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

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

int main(){
	int num;
	std::string fa = "Hoshino";
	std::string tr = "Hoshina";
	std::string english;
	std::cin >> num;

	for(int i=0;i<num;i++){
		std::cin >> english;
		for(int j=0;j<english.length();j++){
			if(english[j]==fa){
				if(english[j+7]==" "||english[j+7]=="\0")
					english[j]=tr;
			}
		}
		std::cout << english;
	}
    return 0;
}

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[2000];
		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\n",s);
	}
	return 0;
}

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

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

    std::cin >> n;
    // now, there is "\n ...." in the stream.
    // then, skip the initial '\n'.
    std::getline(std::cin,buf);

    for (int i=0;i < n;++i) {
        std::getline(std::cin,buf);
        std::stringstream ss(buf);

        // replace the first word in the text.
        ss >> buf;
            if (buf == "Hoshino") {
                std::cout << "Hoshina";
            }
            else if (buf == "Hoshino,") {
                std::cout << "Hoshina, ";
            }
            else if (buf == "Hoshino.") {
                std::cout << "Hoshina. ";
            }
            else{
                std::cout << buf;
            }

       // replace the follow-on words with' '.
        while (ss >> buf) {
            if (buf == "Hoshino") {
                std::cout << " Hoshina";
            }
            else if (buf == "Hoshino,") {
                std::cout << " Hoshina,";
            }
            else if (buf == "Hoshino.") {
                std::cout << " Hoshina.";
            }
            else{
                std::cout << " " << buf;
            }
        }
        std::cout << std::endl;
    }

    return 0;
}

C++: 
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
#include <sstream>
#include <vector>
 
int main(void){
    int n; //number of data set
 
    std::cin >> n; //input number of data set
    std::cin.ignore(); //delete cin buffer
 
    for(size_t i = 0; i < n; ++i){
        std::vector<std::string> str; //string data
        std::string line; //outputted line data 
         
        std::string buf;
        std::string tmp;
 
        std::getline(std::cin, buf); //input line data
        std::istringstream is(buf);
 
        while(is >> tmp){ //input word
            while(tmp.find("Hoshino") != -1){ //judge word
                tmp.replace(tmp.find("Hoshino"), 7, "Hoshina");
            }
            str.push_back(tmp); //add word to list
        }
 
        //make outputted line data
        for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
            if(it == (str.end() - 1)){
                line = line + *it;
            }else{
                line = line + *it + " ";
            }
        }
 
        //output line data
        std::cout << line << std::endl;
    }
 
    return 0;
}