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; int j,days=-1; for(j=1;;j++){ cin >> p >> e >> i >> d; if(p==-1 && e ==-1 && i==-1 && d == -1) break; for(int x = 21252; x > d ;x--) { if( (x-p)%23 == 0 && (x-e)%28 ==0 && (x-i)%33 == 0 ) {days = x-d;break;} } printf("\nCase %d: the next triple peak occurs in %d days.", j, days); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator