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