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

Re:Runtime Error疯了。实在找不到RE的原因啊!!!

Posted by ych_tiger at 2008-04-21 19:59:21 on Problem 1132
In Reply To:Runtime Error疯了。实在找不到RE的原因啊!!! Posted by:doommetal at 2008-04-01 17:31:25
> #include<stdio.h>
> #include<string.h>
> #define maxn 32
> int maze[maxn][maxn];
> int main()
> {
> 	freopen("f.in","r",stdin);
> 
> 	int t,i,j,x,y,k,cs=1;
> 	char str[maxn];
> 	scanf("%d",&t);
> 	while(t--)
> 	{
> 		printf("Bitmap #%d\n",cs++);
> 		scanf("%d%d\n",&x,&y);
> 		for(i=0;i<maxn;i++)
> 			for(j=0;j<maxn;j++)
> 				maze[i][j]=0;
> 		scanf("%s\n",str);
> 		for(i=0;str[i]!='.' && str[i];i++)
> 		{
> 			switch(str[i])
> 			{
> 			case 'E':maze[x][y-1]=1;x++;break;
> 			case 'N':maze[x][y]=1;y++;break;
> 			case 'W':maze[x-1][y]=1;x--;break;
> 			case 'S':maze[x-1][y-1]=1;y--;break;
> 			default:break;
> 			}
> 		}
> 		for(j=31;j>=0;j--){
> 			for(i=0;i<32;i++)
> 				if(maze[i][j])
> 					printf("X");
> 				else
> 					printf(".");
> 			printf("\n");
> 		}
> 		printf("\n");
> 	}
> }

你的数组开的太小了

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