#include<iostream> using namespace std; int main() { int p,e,i,d,count; count=0; while(cin>>p>>e>>i>>d&&p!=-1) { count++; for (int j=1;j<21253;j++) { int cur=d+j; if ((cur-i)%33==0) { if ((cur-e)%28==0) { if ((cur-p)%23==0) { cout<<"Case "<<count<<": the next triple peak occurs in "<<j<<" days."<<endl; break; } } } } } return 0; }
作者:u011613729 发表于2013-9-19 14:03:01 原文链接
阅读:20 评论:0 查看评论