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 wuanping at 2008-07-01 09:24:38 on Problem 1006
#include<stdio.h>
main()
{
	int a[10],b[10],c[10],d[10],i,j,k;
	for(i=0;i<10;i++)
	{
		scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]);
		if(a[i]==-1&&b[i]==-1&&c[i]==-1&&d[i]==-1)
		break;
	}
	
	for(j=0;j<=i-1;j++)
	{
		for(k=33;k<=21252;k++)
		{
			if(  (k+d[j]-a[j])%23==0&&(k+d[j]-b[j])%28==0&&(k+d[j]-c[j])%33==0 )
			break;
		}
		printf("Case %d: the next triple peak occurs in %d days.\n",j+1,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