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

int main(){
	int n;
	string s;
	
	cin >> n;
	cin.ignore();
	for(int i=0 ; i<n  ; i++){
		getline( cin , s );
		
		if( s.find("Hoshino",0) != string::npos){
			unsigned i = s.find("Hoshino",0);
			s.replace( i , 7 , "Hoshina" );
		}
		cout << s << endl;
	}
	
	return 0;
}

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

C++: #include <iostream>

using namespace std;
int main(){
	int d;
	cin>>d;
	string buf;
	string key="Hoshino";
	string newkey="Hoshina";
	unsigned int p;
getline(cin,buf);
	while(d--){
		getline(cin,buf);
		while((p=buf.find(key,0))!=string::npos){
			buf.replace(p,key.size(),newkey);
		}
		cout<<buf<<endl;
	}
	return 0;
}

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

void replace_all(std::string& str, const std::string& from, const std::string& to) {
    std::size_t start_pos = 0;
    while( (start_pos = str.find(from, start_pos)) != std::string::npos ) {
        str.replace(start_pos, from.length(), to);
        start_pos += to.length();
    }
}

int main(void) {
    u_int n;
    std::string str;
    const std::string from  = "Hoshino";
    const std::string to    = "Hoshina";

    std::cin >> n; std::cin.ignore(); // ignore next newline character
    for (u_int i = 0; i < n; ++i) {
        std::getline(std::cin, str);
        replace_all(str, from, to);
        std::cout << str << std::endl;
    }

    return 0;
}

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

int main()
{
	char befor[8] = "Hoshino";
	char in[1001],*torget;
	int n;

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

	for(int i = 0; i < n; i++){
		fflush(stdin);
		gets(in);
		while( (torget = strstr(in,befor)) != NULL){
			//torget += 6;
			*torget = 'a';
		}
		printf("%s\n",in);
	}


	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
using namespace std;

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

#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T> void preview(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}

const int INF = 100000000;
const double PI = acos(-1.0), EPS = 1e-10;

int main() {
	int N; cin >> N;
	cin.ignore();
	rep(i,N) {
		string line;
		getline(cin, line);
		istringstream is(line);
		bool fst = true;
		for(string w; is >> w;) {
			if(!fst) cout << " ";
			if(w == "Hoshino") cout << "Hoshina";
			else cout << w;
			fst = false;
		}
		cout << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main ()
{
    char ara[10000],ara2[100000];
    int a,b,c,i,j,k,n;
    cin>>n;
    getchar();
    for (i=0;i<n;i++,printf ("\n"))
    {
        scanf("%[^\n]",ara);
        getchar();
        for (j=0;ara[j]!='\0';j++)
        {
            if (ara[j]=='o')
                if (ara[j-5]=='o' && ara[j-4]=='s' && ara[j-3]=='h' && ara[j-2]=='i' && ara[j-1]=='n' && ara[j-6]=='H')
            {
                ara[j]='a';
            }

        }
        printf ("%s",ara);
    }
}

C++: #include<stdio.h>

int main()
{
	int n,i,j=0,k;
	char str[1008],temp;
	
	scanf("%d",&n);
	temp=getchar();
	for(i=0;i<n;i++){
		for(j=0;;j++){
			str[j] = getchar();
			if(str[j] == '\n'){
				str[j] = '\0';
				break;
			}
		}
		
		for(k=0;k<j;k++){
			if(str[k]=='H' && str[k+1]=='o' && str[k+2]=='s' && str[k+3]=='h' && str[k+4]=='i' && str[k+5]=='n' && str[k+6]=='o')str[k+6]='a';
		}
		printf("%s\n",str);
	}
	
	return 0;
}

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

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

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

    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) {
            // fix miss
            for (unsigned int i = cur; i < pos; i++) {
                std::cout << str.at(i);
            }
            std::cout << CORRECT_STR;

            // increase cursor
            cur += (pos + MISS_STR.size());

            pos = str.find(MISS_STR, cur);
        }

        for (unsigned int i = cur; i < str_size; i++) {
            std::cout << str.at(i);
        }
        std::cout << std::endl;
    }

    return 0;
}

C++: #include <stack>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <utility>
#include <math.h>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>

using namespace std;

int ssearch(string s, string p, string r)
{
    unsigned long sl = s.size();
    unsigned long pl=p.size();
    for(int i = 0; i< sl-pl+1;i++)
    {
        bool ch = true;
        for(int j = 0; j < pl;j++)
        {
            if(s[i] != p[j])
            {
                ch = false;
                break;
            }
        }
        if(ch)
        {
            for(int k = 0; k < pl; k++)
            {
                s[i+k] = r[k];
            }
            i+=pl;
        }
    }
    return 0;
}

int main() {
    
    int n;
    string str;
    getline(cin,str);
    n = atoi(str.c_str());
    for(int t = 0;t<n;t++)
    {

        getline(cin,str);
        ssearch(str,"Hoshino","Hoshina");
        cout << str << endl;
    }

    return 0;
}

C++: import java.util.*;
class Main{
  public static void main(String[]z){
    Scanner x=new Scanner(System.in);
    int n=x.nextInt();x.nextLine();
    for(;n>0;n--){
      String s=x.nextLine();
      System.out.println(s.replaceAll("Hoshino","Hoshina"));
    }
  }
}

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

int main(){
	const string t("Hoshino"), t2("Hoshina");
	int n;
	cin >> n;
	string s;
	getline(cin, s);
	for(int i = 0; i < n; i++){
		getline(cin, s);
		string::iterator iter = search(s.begin(), s.end(), t.begin(), t.end());
		for(string::iterator it = s.begin(); it != iter; it++) cout << *it;
		while(iter != s.end()){
			cout << t2;
			iter += t2.size();
			string::iterator it = iter;
			iter = search(iter, s.end(), t.begin(), t.end());
			for(;it != iter; it++) cout << *it;
		}
		cout << endl;
	}
	return 0;
}

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

int main(void) {
  string str;
  int n;
  string temp;
  cin >> n;
  getchar();
  for(int i = 0; i < n; i++) {
    getline(cin, str);
    for(int j = 0; j < (int)str.length()-6; j++) {
      if(str[j] == 'H') {
	temp = str.substr(j, 7);
	if(temp == "Hoshino") {
	  str[j+6] = 'a';
	}
      }
    }
    cout << str << endl;
  }
  return 0;
}