| ||||||||||
| 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 | |||||||||
我的SAMPLE也是对的,可是提交了就是WRONG ANSWER,各位帮帮忙啊,谢谢了!!#include <iostream>
using namespace std;
int main()
{ long p,e,i,d;
long a;
long number=1;
while(cin>>p>>e>>i>>d){
if(p==-1 && e==-1 && i==-1 && d==-1) break;
for(a=1;;a++){
if((a-p)%23==0 && (a-e)%28==0 && (a-i)%33==0){
cout<<"Case "<<number<<": the next triple peak occurs in "<<a-d+1<<" days."<<endl;
number++;
break;
}
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator