| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
WA 不知何故,请指教#include <stdio.h>
int main()
{
int a[32][32]={0};
int x,y,i,j,k,test;
char s;
scanf("%d",&test);
for(k=1;k<=test;k++)
{
scanf("%d%d",&x,&y);
getchar();
while((s=getchar())!='.')
{
if(s=='N')
{
a[x][y]=1;
y++;
}
else if(s=='S')
{
a[x-1][y-1]=1;
y--;
}
else if(s=='W')
{
a[x-1][y]=1;
x--;
}
else if(s=='E')
{
a[x][y-1]=1;
x++;
}
}
getchar();
printf("Bitmap #%d\n",k);
for(i=31;i>=0;i--)
{
for(j=0;j<32;j++)
{
if(a[j][i]==0)
printf(".");
else
printf("X");
}
printf("\n");
}
printf("\n");
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator