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; int main() { int a, b, c, d, times, t = 0; while (1) { cin >> a >> b >> c >> d; if (a == -1) break; t ++; for (int i = 1; ; i ++) if ((i + d - a) % 23 == 0 && (i + d - b) % 28 == 0 && (i + d - c) % 33 == 0) { cout << "Case " << t << ": the next triple peak occurs in " << i << " days" << endl; break; } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator