#include<iostream>
using namespace std;
int main()
{
int p,e,i,d,re[1000],count=-1,t;
while(cin>>p>>e>>i>>d)
{
if((p==-1)&&(e==-1)&&(i==-1)&&(d==-1)) break;
re[++count]=(5544*p+14421*e+1288*i-d)%21252;
if(re[count]<=0)re[count]+=21252;
}
for(t=0;t<=count;t++)
{
cout<<"Case "<<t+1<<": the next triple peak occurs in "<<re[t]<<" days."<<endl;
}
system("pause");
return 0;
}
poj1006中国剩余定理
最新推荐文章于 2024-07-13 13:36:16 发布