#include #include #include #include using namespace std; vector> get_input(const string &FILE_NAME) { ifstream file(FILE_NAME); vector> result; vector local_vec; size_t pos = 0; string s; while (getline(file, s)) { while ((pos = s.find(" ")) != string::npos) { if (pos == 0) { s.erase(0, 1); continue; } local_vec.push_back(s.substr(0, pos)); s.erase(0, pos); } local_vec.push_back(s); result.push_back(local_vec); local_vec.erase(local_vec.end()); } return result; } int main() { return 0; const string &FILE_NAME = "example.txt"; vector> input = get_input(FILE_NAME); for (vector vec : input) { cout << "Vec: " << endl; for (string s : vec) { cout << s << endl; ; } } }