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

请教高手:为什么在vc通过,在这里提交会出现“run time error”?

Posted by 90301118 at 2003-11-17 22:28:58 on Problem 1006
#include <stdio.h>
#include <math.h>

void main()
{
	int a,b,c,d,x,j[10],i,k;
	for (i=1;;i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&d);
		if (a==-1&&b==-1&&c==-1&&d==-1) break;
		
			for (x=33;;x++)//穷举算法
			if (x%23==a%23&&x%28==b%28&&x%33==c%33)
					break;
					j[i]=x-d;
	}
	for (k=1;k<i;k++)
	printf("Case %d: the next triple peak occurs in %d days.\n",k,j[k]);
}

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