fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6.  
  7.  
  8. int main() {
  9. auto& source = std::cin;
  10.  
  11. const int SIZE = 37;
  12. std::string table_h[SIZE];
  13. std::string table_v[SIZE];
  14.  
  15. for (size_t i = 0; i < SIZE; ++i)
  16. {
  17. table_h[i].resize(SIZE);
  18. table_v[i].resize(SIZE);
  19. }
  20.  
  21. int i = 0;
  22. while (source >> table_h[i])
  23. {
  24. for (int j = 0; j < SIZE; j++)
  25. {
  26. table_v[j][i] = table_h[i][j];
  27. }
  28. i++;
  29. }
  30.  
  31. for (size_t i = 0; i < SIZE; ++i)
  32. {
  33. std::cout << table_v[i] << std::endl;
  34. }
  35. }
Success #stdin #stdout 0s 3236KB
stdin
azert qsdfg wxcvb poiuy mlkjh
stdout
aqwpm
zsxol
edcik
rfvuj
tgbyh