[백준 10798] 세로 읽기
Algorithm/백준(BOJ)

[백준 10798] 세로 읽기

반응형

[백준 10798] 세로 읽기


문제 출처 : https://www.acmicpc.net/problem/10798






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Problem10798 {
 
    static String[][] map;
    static int n;
    //static int max = 0;
    
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        map = new String[15][15];
        
        for (int i = 0; i < 5; i++) {
            String[] str = br.readLine().split("");
            n = str.length;
            //if(max < n) max = n;
            for (int j = 0; j < n; j++) {
                map[i][j] = str[j];
            }
        }
        
        for (int i = 0; i < map.length; i++) {
            for (int j = 0; j < map.length; j++) {
                if(map[j][i] != null)
                    System.out.print(map[j][i]);
            }
        }
        
    }
 
}
 
cs

반응형