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:为什么过不去呢,虚心求教

Posted by tua1120151790 at 2016-06-10 12:32:06 on Problem 1006
In Reply To:为什么过不去呢,虚心求教 Posted by:tua1120151790 at 2016-06-09 11:16:33
> #include <stdio.h>
> #define peak 21252+365
> #include <stdlib.h>
> int main()
> {
>     int p,e,i,d;
>     int count=0;
>     int k;
>     while(scanf("%d%d%d%d",&p,&e,&i,&d)==4&&p!=-1)
>     {    
>         int n=0;
>         count++;
>         p=p%23;
>         e=e%28;
>         i=i%33;
>         for(n=peak;n>=0;n--)
>         {
>          if((n-p)%23==0&&(n-e)%28==0&&(n-i)%33==0)
>           break;
>         } 
>         printf("Case %d: the next triple peak occurs in %d days.\n",count,n-d);
>     }
>    
>     system("pause");
> 
> 
> }           
>     

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