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 <array>
#include <string>

int main(){
  int n;
  int i = 0;
  int flag = 0;
    std::array<std::string, 1000> str = {};

  std::cin >> n;

  while(n > 0){
    while(std::cin >> str[i]){
      ++flag;
        ++i;
    }
      for(int j = 0;j < flag;++j){
          if(str[j] == "Hoshino")
              str[j] = "Hoshina";
      }
      for(int j = 0;j < i;++j){
          std::cout << str[j];
      }
      std::cout << endl;
      
      flag = 0;
      i = 0;
      --n;
  }
}

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    int i,j,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        char a[1050]={0};
        fflush(stdin);
        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 <stdio.h>
#include <string.h>

int main(void) {

  int n;
  char word[200];

  char buf[200];

  char* p;
  char c;
  int i;
  
  scanf("%d",&n);
  c=getchar();

  for(i=0;i<n;i++) {

    fgets(buf,sizeof(buf),stdin);

    buf[strlen(buf)-1]='\0';

    word[0]='\0';

    p=strtok(buf," ");
    if(strcmp(p,"Hoshino")==0) {
      strcat(word,"Hoshina");
    }
    else {
      strcat(word,p);
    }

    while((p=strtok(NULL," "))!=NULL) {
      if(strcmp(p,"Hoshino")==0) {
	strcat(word," Hoshina");
      }
      else {
	strcat(word," ");
	strcat(word,p);
      }
    }

    printf("%s\n",word);

  }

  return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <bitset>
using namespace std;
#define INF	100000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define SS stringstream
#define rep(i,n) for(int i = 0; i < n; i++)
#define sz(x) ((int)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).begin(), (x).end(), greater<int>() )
#define clr(a,b) memset((a),(b),sizeof(a))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<P> Vp;
typedef priority_queue<P, vector<P>, greater<P> > PQ;

int n;
string str;

int main(){
	cin >> n;
	cin.ignore();
	rep(i,n){
		getline(cin,str);
		rep(j,str.size()-6){
			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';
			}
		}
		cout << str << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

int n;
string s;

int main(){
	cin >> n;
	cin.ignore();
	REP(i,n){
		getline(cin, s);
		string ans = "";
		stringstream ss;
		string buf;
		bool f = 0;
		ss << s;
		while (ss >> buf){
			if (buf.find("Hoshino") != -1){
				buf[buf.find("Hoshino") + 6] = 'a';
			}
			if (f == 0){
				ans += buf;
				f = 1;
			}
			else{
				ans += ' ' + buf;
			}
		}
		cout << ans << endl;
		ans.clear();
	}
}

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

int main(){

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

	std::cin >> N;
	std::cin.ignore();

	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++: //Name: Aizu PR
//Level: 1
//Category: 文字列,String,やるだけ
//Note:

#include <iostream>
#include <string>

using namespace std;

bool solve() {
    int N;
    if(!(cin >> N)) return false;
    cin.ignore();
    for(int i = 0; i < N; ++i) {
        string str;
        getline(cin, str);
        while(true) {
            size_t pos = str.find("Hoshino");
            if(pos == string::npos) break;
            str = str.substr(0, pos) + "Hoshina" + str.substr(pos + 7);
        }
        cout << str << endl;
    }
    return true;
}

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

    while(solve()) ;
    return 0;
}

C++: #define scanf_s scanf
#define sscanf_s sscanf
#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 1001
#define HO 6
int main(void)
{
	int n;
	char str[MAX], no[] = { "Hoshino" }, na[] = { "Hoshina" };
	gets_s(str);
	sscanf_s(str, "%d", &n);
	for (int i = 0; i < n; ++i) {
		gets_s(str);
		for (int j = 0; str[j] != '\0'; ++j) {
			if (no[HO] == str[j] && j >= HO) {
				for (int k = 0; k <= HO; ++k) {
					if (str[j - k] != no[HO - k]) break;
					else if (k == HO) {
						str[j] = na[HO];
					}
				}
			}
			printf("%c", str[j]);
		}
		printf("\n");
	}
}

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

int main(){
	int n;
	string spot;
	cin>>n;
	cin.ignore();
	for(int i=0;i<n;i++){
		getline(cin,spot);
		for(int j=0;j<spot.size()-6;j++){
			string str="";
			for(int k=j;k<j+7;k++){
				str+=spot[k];
			}
			if(str=="Hoshino"){
				spot[j+6]='a';
			}
		}
		cout<<spot<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main(){
	int n;
	string s;
	cin>>n;cin.get();
	while(n-->0){
		getline(cin,s);
		for(int i=0;i<s.size();i++){
			if(s.substr(i,7)=="Hoshino")
				s[i+6]='a';
		}
		cout<<s<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
char a[1050]={0};
int main()
{
    int i,j,k,n;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        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;
    }
    return 0;
}