문제

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
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[][] chars = new char[5][15];

        String answer = "";
        for (int i = 0; i < chars.length; i++) {
            String str = sc.nextLine();


            for (int j = 0; j < str.length(); j++) {
                chars[i][j] = str.charAt(j);
            }
        }

        for (int i = 0; i < 15; i++) {
            for (int j = 0; j < 5; j++) {
                if(chars[j][i] == '\0') {
                    continue;
                }
                System.out.print(chars[j][i]);
            }
        }
    }
}

카테고리:

업데이트:

댓글남기기