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

Re:why this is wrong.HELP!! 1006

Posted by 90401504 at 2004-12-01 08:27:51
In Reply To:why this is wrong.HELP!! 1006 Posted by:90401504 at 2004-11-23 18:29:40
> #include <stdio.h>
> #include <math.h>
> void main(){
>           int p,e,i,d,j,no=1;
>           scanf("%d %d %d %d\n",&p,&e,&i,&d);
>           while(p!=-1 && e!=-1 && i!=-1 && d!=-1){
>                 for(j=d+1; j<=21252; j++)     if ((j-p)%23 == 0) break;
>                 for( ; j<=21252; j=j+23)         if ((j-e)%28 == 0) break;
>                 for( ; j<=21252; j=j+23*28)  if ((j-i)%33 == 0) break; 
>                 scanf("%d %d %d %d\n",&p,&e,&i,&d);
>                 no++; 
>                 printf("Case %d: the next triple peak occurs in %d days.\n",no,j-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