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 shunfeng at 2008-07-16 15:24:41
#include<stdio.h>
int main()
{
    int p,e,i,d,k=0,n,m;
	do
	{
	   scanf("%d %d %d %d",&p,&e,&i,&d);
	}while(p>365||e>365||i>365||d>365);
	while(1)
	{
		if(p==-1&&e==-1&&i==-1&&d==-1)
			break;
		k++;
		p%=23;e%=28;i%=33;
        m=i+33;
		while(m%23!=p||m%28!=e)
			m+=33;
		n=m-d;
		while(n>21252)
			n-=21252;
		if(n==0)
			n=23*28*33;
		printf("Case %d: the next triple peak occurs in %d days.\n",k,n);
		do
		{
	       scanf("%d %d %d %d",&p,&e,&i,&d);
		}while(p>365||e>365||i>365||d>365);
	}
	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