fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4. #include <array>
  5.  
  6. template <typename T, int N>
  7. using Table = std::map<std::string, std::array<T,N>>;
  8.  
  9. int main() {
  10.  
  11. Table<int, 5> table;
  12.  
  13. // Добавляем пару столбцов
  14. table["row1"] = std::array<int,5> { 1,2,3,4,5};
  15. table["row2"] = std::array<int,5> { 6,7,8,9,0};
  16.  
  17. // Выводим некоторые значения
  18. std::cout << table["row1"][0] << std::endl;
  19. std::cout << table["row2"][3] << std::endl;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3432KB
stdin
Standard input is empty
stdout
1
9