| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:为什么过不去呢,虚心求教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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator