-
Notifications
You must be signed in to change notification settings - Fork 0
/
11586.java
50 lines (39 loc) · 952 Bytes
/
11586.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.io.*;
public class Main {
static StringBuilder sb = new StringBuilder();
static char map[][];
static int N;
public static void main(String args[]) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(input.readLine());
map= new char[N][N];
for(int i=0; i<N; i++) {
map[i] = input.readLine().toCharArray();
}
int cmd = Integer.parseInt(input.readLine());
switch(cmd) {
case 1 : show1(); break;
case 2 : show2(); break;
case 3 : show3(); break;
}
System.out.println(sb);
}
static void show3() {
for(int i=N-1; i>=0; i--) {
sb.append(String.valueOf(map[i])+"\n");
}
}
static void show2() {
for(int i=0; i<N; i++) {
for(int j=N-1; j>=0; j--) {
sb.append(map[i][j]);
}
sb.append("\n");
}
}
static void show1() {
for(int i=0; i<N; i++) {
sb.append(String.valueOf(map[i])+"\n");
}
}
}