| ||||||||||
| 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 | |||||||||
请大家帮帮忙,不知道哪里出错了?算出的结果没错,但是是wrong answer#include<iostream>
using namespace std;
int main()
{
int p,e,i,d,sum=0,t=1,j;
cin>>p>>e>>i>>d;
while(p!=-1||e!=-1||i!=-1||d!=-1)
{
for(j=1;sum<21252;j++)
{
sum=j*23+p;
if((sum-e)%28==0&&(sum-i)%33==0)
{
cout<<"Case "<<t<<": the next triple peak occurs in "<<sum-d<< " days."<<endl;
break;
}
}
t++;
sum=0;
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