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 <cstdio>
#include <cstring>
using namespace std;

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

	cin >> n;

	for (int i = 0; i < n; i++){
		fgets(str, sizeof(str), stdin);

		int len = strlen(str);
		for (int j = 0; j < len - 6; j++){
			if (strncmp(&str[j], "Hoshino", 7) == 0){
				str[j + 6] = 'a';
			}
		}

		cout << str;
	}

	return (0);
}

C++: #include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int N;
    cin>>N;
    getchar();
    for(int i=0;i<N;i++){
        string S;
        getline(cin,S);
        while(S.find("Hoshino")!=-1){
            S.replace(S.find("Hoshino"),7,"Hoshina");
        }
        cout<<S<<endl;
    }
    return 0;
}

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

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){
    
    int n; cin>>n;
    REP(i,n){
        string s;
        getline(cin,s);
        while(s.find("Hoshino")!=string::npos){
            s[s.find("Hoshino")+6]='a';
        }
        cout<<s<<endl;
    }
    
    return 0;
}

C++: // 2011/01/12 Tazoe

#include <iostream>
#include <string>
using namespace std;

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

	string eng;
	getline(cin, eng);

	for(int i=0; i<n; i++){
		getline(cin, eng);
		while(true){
			string::size_type index = eng.find("Hoshino");
			if(index == string::npos)
				break;
			else
				eng.replace(index, 7, "Hoshina");
		}

		cout << eng << endl;
	}

	return 0;
}

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

int main(void){
	std::string tmp;
	u_int n; //number of data set

	std::cin >> n; //input number of data set
	std::cin.ignore();

	for(size_t i = 0; i < n; ++i){
		std::vector<std::string> str; //string data
		std::string buf;

		std::getline(std::cin, buf); //input line
		std::istringstream is(buf);

		while(is >> tmp){ //input word
			if(tmp == "Hoshino"){ //judge word
				tmp = "Hoshina";
			}
			str.push_back(tmp); //add word to list
		}

		//output line
		for(std::vector<std::string>::iterator it = str.begin(); it != str.end(); ++it){
        	std::cout << *it << " ";
        }
        std::cout << std::endl;
	}

	return 0;
}

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

int main(){
	int dataSetNum;
	std::cin >> dataSetNum;
	std::vector<string> *str = new std::vector<string>[dataSetNum];
	//input & sprit
	for(int i = 0; i < dataSetNum; ++i){
		//input
		std::string tmp;
		std::string buf;

		std::cin >> tmp;

		std::stringstream ss(tmp);
		//sprit
		while( getline(ss, buf, ' ') ){
			str[i].push_back(buf);
		}

	}

	//replace
	for(int i = 0; i < dataSetNum; ++i){
		std::replace_if(str[i].begin(), str[i].end(),
    [](string x) { return x == 'Hoshino'; }, 'Hoshina');
	}

	//output
	for(int i = 0; i < dataSetNum; ++i){
		std::for_each(str[i].begin(), str[i].end(),
    [](string x) { std::cout << x << 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]==false){
				if(english[j+7]==" "||english[j+7]=="\0")
					english[j]=true;
			}
		}
		std::cout << english;
	}
    return 0;
}

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

using namespace std;

int main(void)
{
	int n;
	string a;
	string g = "Hoshino";

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

C++: #include <iostream>
#include <string>
using namespace std;
int search(string a,int *loc){
	*loc = a.find("Hoshino",0);
	return *loc;
}
int main(){
	string a,t="Hoshina";
	int n,loc;
	cin >> n;
	getline(cin,a);
	while(n--){
		loc=0;
		getline(cin,a);
		while(~search(a,&loc)) a.replace(loc,t.length(),t);
		cout << a << endl;
	}
	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>
using namespace std;

int main(void){

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

    string text,s,ret;
    string str = "Hoshino";
    string astr = "Hoshina";

    for(int i = 0; i < n; ++i) {
        getline(cin, text);
        ret = text;
        for(int j = 0; j < text.length()-6; ++j) {
            s = text.substr(j,str.length());
            if (s.compare(str) == 0) {
                ret = text.replace(j, astr.length(), astr);
            }

        }

        cout << ret << endl;

    }

}

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

#define BAD "hoshino"

int hoge(void);

int main(){
	int n,i;
	
	cin>>n;
	for(i=0;i<n;i++){
	 hoge();
	}
	
	return 0;
}

int hoge(){
	string text;
	int i;
	
	cin>>text;
	if(7<=text.length()){
	for(i=0;i<text.length()-7;i++){
	 if(text.substr(i,7)==BAD){
	  text[i+6]='a';
	 }
	}
	}
	
	cout<<text<<endl;
	return 0;
}

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

using namespace std;
int main(){
	int n,i,j,h;
	char *p;
	char buf[1100];
	string str;
	string hit="Hoshino";
	string word="Hoshina";
	cin>>n;
	string tmp;
	getline(cin,tmp);
	for(;true;){
		string buf;
		getline(cin,buf);
		if(buf.size()==0)break;

		stringstream ss(buf);
//		cout<<"word :"<<buf<<endl;
		for(int i=0;ss >> str;i++){
			if(i)cout<<" ";
			h=str.size();
			if(str==hit)cout<<word;
			//int st=str.find(hit);
			//if(st>=0)str.replace(st,word.size(),word);
			else cout<<str;
		}
		cout<<endl;
	}
	return 0;
}