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 |
服了。。就是wa。。大牛看看。。#include<iostream> #include<math.h> using namespace std; int main() { int a,b,c,d,i,j=1; while(scanf("%d%d%d%d",&a,&b,&c,&d)&&(a!=-1&&b!=-1&&c!=-1)) { for(i=d+1;i<=21252;i++) { if(abs(i-a+d)%23==0&&abs(i-b+d)%28==0&&abs(i-c+d)%33==0) cout<<"Case "<<j++<<": the next triple peak occurs in "<<i<<" days."<<endl; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator