#include <iostream> #include <vector> int main(){ std::vector < std::vector<std::vector<int>>> vec3d; //static const int N = 4; vec3d.resize(2); for (std::size_t i = 0; i < vec3d.size(); i++){ vec3d[i].resize(3); for (std::size_t j = 0; j < vec3d[i].size(); j++){ vec3d[i][j].resize(4); } } int i = 0; for (auto&ooo : vec3d){ for (auto& oo : ooo){ for (auto& o : oo) o = i++; } } for (auto&ooo : vec3d){ std::cout << '['<<std::endl; for (auto& oo : ooo){ std::cout << '['; for (auto& o : oo) std::cout << o << ','; std::cout << ']'<<std::endl; } std::cout << ']'<<std::endl; } std::cout<<vec3d[1][2][3]; return 0; }
Standard input is empty