Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

WA 不知何故,请指教

Posted by Move at 2006-10-02 20:21:37 on Problem 1132
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator