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