std ::ifstream file ( "data.csv" ) ; if (!file.is_open()) { std :: cerr << "Failed to open file" << std :: endl ; return 1 ; std :: string line; std :: vector < std :: vector < int >> data; while (getline(file, line)) { std :: istringstream linestream (line) ; std :: vector < int > row; std :: string item; while (getline(linestream, item, ',' )) { row.push_back( std ::stoi(item)); data.push_back(row); file.close(); for ( const auto & row : data) { for ( const auto & item : row) { std :: cout << item << " " ; std :: cout << std :: endl ; return 0 ; 清欢_小铭