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];
	std::vector< std::vector<string> > str;
	str.resize(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:33:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
   33 |     [](string x) { return x == 'Hoshino'; }, 'Hoshina');
      |                                ^~~~~~~~~
a.cc:33:46: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes
   33 |     [](string x) { return x == 'Hoshino'; }, 'Hoshina');
      |                                              ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:34: error: 'string' was not declared in this scope
   11 |         std::vector< std::vector<string> > str;
      |                                  ^~~~~~
a.cc:11:34: 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:11:40: error: template argument 1 is invalid
   11 |         std::vector< std::vector<string> > str;
      |                                        ^
a.cc:11:40: error: template argument 2 is invalid
a.cc:11:42: error: template argument 1 is invalid
   11 |         std::vector< std::vector<string> > str;
      |                                          ^
a.cc:11:42: error: template argument 2 is invalid
a.cc:12:13: error: request for member 'resize' in 'str', which is of non-class type 'int'
   12 |         str.resize(dataSetNum);
      |             ^~~~~~
a.cc:25:28: error: invalid types 'int[int]' for array subscript
   25 |                         str[i].push_back(buf);
      |                            ^
a.cc:32:36: error: invalid types 'int[int]' for array subscript
   32 |                 std::replace_if(str[i].begin(), str[i].end(),
      |                                    ^
a.cc:32:52: error: invalid types 'int[int]' for array subscript
   32 |                 std::replace_if(str[i].begin(), str[i].end(),
      |                                                    ^
a.cc:33:8: error: 'string' is not a type
   33 |     [](string x) { return x == 'Hoshino'; }, 'Hoshina');
      |        ^~~~~~
a.cc:38:34: error: invalid types 'int[int]' for array subscript
   38 |                 std::for_each(str[i].begin(), str[i].end(),
      |                                  ^
a.cc:38:50: error: invalid types 'int[int]' for array subscript
   38 |                 std::for_each(str[i].begin(), str[i].end(),
      |                                                  ^
a.cc:39:8: error: 'string' is not a type
   39 |     [](string x) { std::cout << x << std::endl; });
      |        ^~~~~~
a.cc: At global scope:
a.cc:43:9: error: expected unqualified-id before 'return'
   43 |         return 0;
      |         ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^