Language: 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;
}

Compiler output:
a.cc:30:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
   30 |     [](string x) { return x == 'Hoshino'; }, 'Hoshina');
      |                                ^~~~~~~~~
a.cc:30:46: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
   30 |     [](string x) { return x == 'Hoshino'; }, 'Hoshina');
      |                                              ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:21: error: 'string' was not declared in this scope
   10 |         std::vector<string> *str = new std::vector<string>[dataSetNum];
      |                     ^~~~~~
a.cc:10:21: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:27: error: template argument 1 is invalid
   10 |         std::vector<string> *str = new std::vector<string>[dataSetNum];
      |                           ^
a.cc:10:27: error: template argument 2 is invalid
a.cc:10:58: error: template argument 2 is invalid
   10 |         std::vector<string> *str = new std::vector<string>[dataSetNum];
      |                                                          ^
a.cc:22:32: error: request for member 'push_back' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
   22 |                         str[i].push_back(buf);
      |                                ^~~~~~~~~
a.cc:29:40: error: request for member 'begin' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
   29 |                 std::replace_if(str[i].begin(), str[i].end(),
      |                                        ^~~~~
a.cc:29:56: error: request for member 'end' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
   29 |                 std::replace_if(str[i].begin(), str[i].end(),
      |                                                        ^~~
a.cc:30:8: error: 'string' is not a type
   30 |     [](string x) { return x == 'Hoshino'; }, 'Hoshina');
      |        ^~~~~~
a.cc:35:38: error: request for member 'begin' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
   35 |                 std::for_each(str[i].begin(), str[i].end(),
      |                                      ^~~~~
a.cc:35:54: error: request for member 'end' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int'
   35 |                 std::for_each(str[i].begin(), str[i].end(),
      |                                                      ^~~
a.cc:36:8: error: 'string' is not a type
   36 |     [](string x) { std::cout << x << std::endl; });
      |        ^~~~~~
a.cc: At global scope:
a.cc:39:9: error: expected unqualified-id before 'return'
   39 |         return 0;
      |         ^~~~~~
a.cc:40:1: error: expected declaration before '}' token
   40 | }
      | ^