-
Notifications
You must be signed in to change notification settings - Fork 0
/
poj_1132.cpp
44 lines (44 loc) · 1009 Bytes
/
poj_1132.cpp
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
#include <string>
#include <cstdio>
#include <vector>
#include <iostream>
using namespace std;
int main() {
int n;
scanf("%d", &n);
int cnt=1;
while (n--) {
int i,j;
char c;
vector<string> map(32, string(32, '.'));
scanf("%d %d", &i, &j);
getchar();
printf("Bitmap #%d\n", cnt++);
while (true) {
scanf("%c", &c);
if (c == '.') break;
if (c == 'E') {
map[i][j-1] = 'X';
i++;
}
if (c == 'W') {
map[i-1][j] = 'X';
i--;
}
if (c == 'N') {
map[i][j] = 'X';
j++;
}
if (c == 'S') {
map[i-1][j-1] = 'X';
j--;
}
}
for (int j = 31; j >= 0; --j) {
for (int i = 0; i <= 31; ++i)
cout<<map[i][j];
cout<<endl;
}
cout<<endl;
}
}