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

Why???What's wrong!!!

Posted by ibm at 2004-04-28 14:21:43 on Problem 1006
#include<stdio.h>
void main()
{
	int a,b,c,d,t,tt;
	int i=1;
	while(1)
	{
	  scanf("%d %d %d %d",&a,&b,&c,&d);
	  if(a==-1&&b==-1&&c==-1&&d==-1)
             break;
	  if(a==b&&b==c)
	    printf("Case %d: the next triple peak occurs in %d days.\n",i++,a+21252-d);
           else
           {
	     tt=c+33;
	     while(((tt-a)%23||(tt-b)%28)&&tt<=21252)
		tt+=33;
	     if(tt<d)
		printf("Case %d: the next triple peak occurs in %d  days.\n",i++,tt+21252-d);
              else
	         printf("Case %d: the next triple peak occurs in %d days.\n",i++,tt-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