Run ID:44581
提交时间:2023-02-18 17:51:03
#include<iostream> using namespace std; int main() { int p, e, i, d; while (cin >> p >> e >> i >> d && p!= -1) { int k = d+1; for (; (k - p) % 23; k++); for (; (k - e) % 28; k=k+23); for (; (k - i) % 33; k = k + 23*28); cout<< "the next triple peak occurs in " << k-d << " days." << endl; } return 0; }