PersonalCorpus 版 (精华区)

1147979 Big Guava ... 320 Accepted
0:00.000 64 2002/10/05 18:51:33.847


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.280毫秒