fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string str = "";
  8.  
  9. char arr[5][15] = {' ',}; // 다 * 로 초기화.
  10. for(int i = 0; i < 5; i++){
  11. for(int j = 0; j < 15; j++){
  12. char ch; cin.get(ch); if(ch=='\n') break;
  13. arr[i][j] = ch;
  14. }
  15. }
  16. for(int i = 0; i < 15; i++){
  17. for(int j = 0; j < 5; j++){
  18. if(arr[j][i] != ' ') str += arr[j][i];
  19. }
  20. }
  21. cout << str;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5548KB
stdin
A
BB
CCC
DDDD
EEEEE
stdout
ABCDEBCDECDEDEEEEEEEEEEEE