| ||||||||||
| 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 | |||||||||
哪里有错??测试了n组数据……提交还是WA
#include <iostream.h>
void main()
{
int a,b,c,d,t=0;
while(++t)
{
cin>>a>>b>>c>>d;
if(a>365||b>365||c>365||d>365||a<=-1||b<=-1||c<=-1||d<=-1)
return;
for(int i=a; ;i+=23)
{
if(a==b&&a==c)
{
if(a<=d) i=23*28*33+a;
else break;
break;
}
if((i-b)%28==0 && (i-c)%33==0) break;
}
cout<<"Case "<<t<<": the next triple peak occurs in "<<i-d<<" days."<<endl;
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator