| ||||||||||
| 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 | |||||||||
救命呀!!!!In Reply To:各位老大帮忙看看吧! Posted by:joggi at 2004-05-27 15:56:47 >#include <stdio.h>
#include<iostream.h>
main()
{ int i,m,tc=1;
int x,y,z,d;
while(1)
{ cin>>x>>y>>z>>d;
if(x==-1||y==-1||z==-1||d==-1||x>365||y>365||z>365||d>365)
break;
i=0;
while(1)
{
m=33*i+z;
i++;
if((m-y)%28==0&&(m-x)%23==0)
break;
}
m=m-d;
if(m==0)
m=21252;
if(m<0)
m=21252+m;
cout<<"Case "<<tc<<": the next triple peak occurs in "<<m<<" days."<<endl;
tc++;
}
}
//到底陷阱在那里,我找不到呀,咋的都是WA!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator