| ||||||||||
| 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 | |||||||||
帮帮忙啊1006 我的答案与给的一模一样 可还是WA#include <iostream>
# define N 500
using namespace std;
int main()
{
int p,e,i,d,n=1,x=21252,j;
for(int t=0;t<N;++t){
cin>>p>>e>>i>>d;
if((p!=-1)&&(e!=-1)&&(i!=-1)&&(d!=-1)){
for( j=d+1;j<=x;++j){
if(((j-p)%23==0)&&((j-e)%28==0)&&((j-i)%33==0)){
cout<<"Case "<<n <<": the next triple peak occurs in "<< j-d<< " days."<<endl;
break;
}
}
}
else break;
n++;
}
system("pause");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator