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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

bool is_change(string str,char* tmp,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++){
			tmp[i] = A[j];
		}
		return true;
	}

	return false;
}

int main(){

	string str;
	while(getline(cin,str)){
		int n;
		sscanf(str.c_str(),"%d",&n);
		for(int idx=0;idx<n;idx++){
			getline(cin,str);
			char tmp[2048];
			strcpy(tmp,str.c_str());
			for(int i=0;i+6<str.size();i++){
				if(is_change(str,tmp,i,7)) i+=7;
			}

			cout << tmp << endl;
		}
	}
}

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

int main(void){
    int datanum;
    char s[1001], *p;
    
    scanf("%d", &datanum);
    fgets(s,sizeof(s),stdin); // skip \n
    for (int i=0; i<datanum; i++){
        fgets(s,sizeof(s),stdin);
        s[strlen(s)-1]='\0'; // eliminate \n
        while (p = strstr(s, "Hoshino")){
            p[6] = 'a';
        }
        printf("%s\n", s);
    }
    
    return 0;   
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
    int n,i,j;
    string str;
    cin >> n;
    for(i=0;i<n;i++){
        getline(cin,str);
        for(j=0;j<str.size();j++){
            if(j+6 > str.size()) break;
            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;
    }
    return 0;
}

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

int main(void)
{
	int n, i;
	char a[1000][1000] = {0};
	char *p;

	while (scanf("%d\n", &n) != EOF)
	{
		for (i = 0; i < n; i++)
			gets(a[i]);
		for (i = 0; i < n; i++)
		{
			p = strstr(a[i], "Hoshino");
			if (p != NULL)
				p[6] = 'a';
		}
		
		for (i = 0; i < n; i++)
			puts(a[i]);
	}
	return 0;
}

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

using namespace std;

int main() {
  int n;
  string s1 = "Hoshino", s2 = "Hoshina";
  string::size_type pos;
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    string line;
    getline(cin, line);
    for (pos = line.find(s1); pos != string::npos; pos = line.find(s1, s2.length() + pos))
      line.replace(pos, s1.length(), s2);
    cout << line << endl;
  }

  return 0;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int n;
	char s[1001];
	char *p;
	scanf("%d",&n);while(getchar()!='\n');
	rep(i,n){
		gets(s);
		p=strstr(s,"Hoshino");
		if(p!=NULL)p[6]='a';
		puts(s);
	}
	return 0;
}

C++: // include
// ----------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>

// repetition
// ----------------------------------------------------------------------------
#define FOR(i, a, b) for (i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// memory clear
// ----------------------------------------------------------------------------
#define CLRNUM(a) memset((a), 0, sizeof(a))
#define CLRBOOL(a, flag) memset((a), flag, sizeof(a))
#define CLRCHAR(a) memset((a), '\0', sizeof(a))

// debug
// ----------------------------------------------------------------------------
#define DEBUGNUM(x) printf("%d\n", x);
#define DEBUGCHAR(x) printf("%c\n", x);
#define DEBUGSTR(x) printf("%s\n", x);
#define DEBUGFORNUM(i, a, b, x) FOR(i, a, b){ printf("%d ", x[i]); }
#define DEBUGFORCHAR(i, a, b, x) FOR(i, a, b){ printf("%c ", x[i]); }
#define DEBUGREPNUM(i, n, x) REP(i, n){ printf("%d ", x[i]); }
#define DEBUGREPCHAR(i, n, x) REP(i, n){ printf("%c ", x[i]); }

// other
// ----------------------------------------------------------------------------
#define PUTNL printf("\n")

// constant
// ----------------------------------------------------------------------------
#define INF 1000000000

int main(void)
{
    int n;
    int i, j;
    char str[1024];

    scanf("%d", &n);

    CLRCHAR(str);

    getchar();
    for (i = 0; i < n; ++i){
        fgets(str, sizeof(str), stdin);
        
        for (j = 0; str[j] != '\0'; j++){
            if (str[j] == 'H'){
                if (str[j + 1] == 'o'){
                    if (str[j + 2] == 's'){
                        if (str[j + 3] == 'h'){
                            if (str[j + 4] == 'i'){
                                if (str[j + 5] == 'n'){
                                    if (str[j + 6] == 'o'){
                                        str[j + 6] = 'a';
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        
        printf("%s", str);
        
        CLRCHAR(str);
    }
    
}

C++: #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  cin.ignore();
  while(n--) {
    string s, t, u;
    getline(cin, s);
    t = "Hoshino";
    u = "Hoshina";
    for(int i = 0; i < s.size(); ++i) {
      if(s.substr(i, t.size()) == t) {
        cout << u;
        i += t.size() - 1;
      } else {
        cout << s[i];
      }
    }
    cout << endl;
  }
  return 0;
}

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

int main()
{
	int WordQuantity = 0,totalcnt = 0,alf = 0;
	char Hoshino[8] = {"Hoshino"};
	char Hoshina[8] = {"Hoshina"};
	int n;

	scanf("%d",&n);
	fflush(stdin);

	for(int loop = 0; loop < n; loop++){
		char words[1000][1001];
		char text[1001];
		totalcnt = 0;

		gets(text);
		fflush(stdin);

		for(WordQuantity = 0; totalcnt < strlen(text); WordQuantity++){
			for(alf = 0; text[totalcnt] != ' ' && totalcnt < strlen(text); alf++){
				words[WordQuantity][alf] = text[totalcnt];
				totalcnt++;
			}
			words[WordQuantity][alf] = '\0';
			totalcnt++;
		}

		for(int i = 0; i < WordQuantity; i++){
			if(strcmp(words[i],Hoshino) == 0){
				strcpy(words[i],Hoshina);
			}
		}

		for(int i = 0; i < WordQuantity-1; i++){
			printf("%s ",words[i]);
		}
		printf("%s\n",words[WordQuantity-1]);

	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
#include <map>
using namespace std;
int main(){
	
	int n;
	string s;
	string d="Hoshina";
	cin>>n;
	getline(cin,s);
	while(n--){
		getline(cin,s);
		while(1){
			unsigned int loc = s.find("Hoshino");
			if(loc!=string::npos)
			s.replace(loc,d.size(),d);
			else
				break;
		}
		cout<<s<<endl;
	}
	
}

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

using namespace std;

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

	string rect = "Hoshino";

	for (int t = 0; t < n; ++t) {
		char str[2000];
		while (scanf("%s", str) != EOF) {
			for (int i = 0; str[i]; ++i) {
				for (int j = 0; j < rect.size() && str[i+j]; ++j) {
					if (str[i+j] != rect[j]) break;
					else if (j == rect.size()-1) str[i+j] = 'a';
				}
			}

			cout << str;

			char c = getchar();
			if (c == '\r' || c == '\n') break;

			cout << " ";
		}
		cout << endl;
	}
}