-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP17363.c
54 lines (48 loc) · 1.23 KB
/
P17363.c
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
51
52
53
54
#include <stdio.h>
#include <stdlib.h>
int main() {
int n, m;
scanf("%d %d", &n, &m);
char **arr = (char**) malloc(sizeof(char*) * n);
for(int i=0; i<n; i++) {
arr[i] = (char*) malloc(sizeof(char) * m + 1);
}
for(int i=0; i<n; i++) {
scanf("%s", arr[i]);
}
for(int x=m-1; x>=0; x--) {
for(int y=0; y<n; y++) {
switch(arr[y][x]) {
case '-':
printf("|");
break;
case '|':
printf("-");
break;
case '/':
printf("\\");
break;
case '\\':
printf("/");
break;
case '^':
printf("<");
break;
case '<':
printf("v");
break;
case 'v':
printf(">");
break;
case '>':
printf("^");
break;
default:
printf("%c", arr[y][x]);
break;
}
}
printf("\n");
}
return 0;
}