-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSolution.java
34 lines (26 loc) Β· 965 Bytes
/
Solution.java
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
package Iterations.swea5356;
import java.io.*;
public class Solution {
static int T;
static String[] map;
public static void main(String[] args) throws Exception {
System.setIn(new FileInputStream("src/Iterations/swea5356/sample_input.txt"));
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
T = Integer.parseInt(br.readLine());
for (int t = 1; t <= T; t++) {
sb.append("#").append(t).append(" ");
map = new String[5];
for (int i = 0; i < 5; i++) map[i] = br.readLine();
for (int i = 0; i < 15; i++) {
for (int j = 0; j < 5; j++) {
if (i < map[j].length()) {
sb.append(map[j].charAt(i));
}
}
}
sb.append("\n");
}
System.out.println(sb.toString());
}
}