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> using namespace std; int main() { int a, b, c, d, i, t = 1; while(cin >> a >> b >> c >> d) { if(a == -1) break; a %= 23; b %= 28; c %= 33; for( i = d + 1; i <= 21252; i++) if((i - a) % 23 == 0 && (i - b) %28 ==0 && (i - c) %33 ==0) break; cout << "Case " << t++<<": the next triple peak occurs in "<<i - d<<" 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