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

各位大哥,帮帮忙,我不知错在哪啊...

Posted by hzx621 at 2005-09-21 16:06:29 on Problem 1006
#include"stdio.h"
#include"math.h"
void main()
{
	int i,k=1,p,e,n,d;
	while(scanf("%d%d%d%d",&p,&e,&i,&d)>0)
	{
	    if(p==-1&&e==-1&&i==-1&&d==-1) break;
	    p=p%23;e=e%28;i=i%33;
	    for(n=d+1;n<=21252;n++)
             {
	        if((n-p)%23==0&&(n-e)%28==0&&(n-i)%33==0)
		{
		    printf("Case %d: the next triple peak occurs in %d days.\n",k++,n-d);
		}
	    }
	}
}

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