PersonalCorpus 版 (精华区)
39068 2002-10-06 00:49:32 Accepted
1300 C++ 00:00.00 384K Big Guava
static int p[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
static char pn[5]="NESW";
static int c[4][2]={{0,0},{0,-1},{-1,-1},{-1,0}};
int main()
{
#ifndef ONLINE_JUDGE
freopen("c:\\0acm\\zju\\i1300","r",stdin);
freopen("c:\\0acm\\zju\\o1300","w",stdout);
#endif
int i,j,k,n,t,x,y;
char map[32][32],s[1000];
scanf("%d\n",&t);
for (n=1;n<=t;n++) {
printf("Bitmap #%d\n",n);
scanf("%d%d\n",&x,&y);
memset(map,'.',sizeof(map));
gets(s);
for (i=0;s[i]!='.';i++) {
j=0; while (pn[j]!=s[i]) j++;
map[x+c[j][0]][y+c[j][1]]='X';
x+=p[j][0]; y+=p[j][1];
}
for (i=31;i>=0;i--) {
for (j=0;j<32;j++) printf("%c",map[j][i]);
printf("\n");
}
printf("\n");
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.881毫秒