본문 바로가기

카테고리 없음

백준 10798번: 세로읽기 (문자열, 구현)

반응형
#include<iostream>
#include<string.h>

using namespace std;

char map[5][15] = {0,};

int main(){
    string temp;
    for(int i=0; i<5; i++){
        cin >> temp;
        for(int j=0; j<temp.length(); j++){
            map[i][j] = temp[j];
        }
    }
    for(int i=0; i<15; i++){
        for(int j=0; j<5; j++){
            if(map[j][i] != 0){
                cout << map[j][i];
            }
        }
    }
}
반응형