| ||||||||||
| 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 | |||||||||
求助~~~~~~~~~~~~~~#include<iostream.h>
#include<math.h>
int main ()
{
int p,e,i,d,days,t=0;
while(1)
{
cin>>p>>e>>i>>d;
if(p==-1) break;
for(int j=0;;j++)
{
if((23*j+p-e)>0&&(23*j+p-e)%28==0&&(23*j+p-i)%33==0)
break;
}
days=23*j+p-d;
cout<<"Case "<<t+1<<": the next triple peak occurs in "<<days<<" days."<<endl;
t++;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator