题目链接:
题意:中文题。
中国剩余定理:
1 #include2 #include 3 4 using namespace std; 5 6 int main() 7 { 8 int p,e,i,d; 9 int Case=1;10 int lcd = 21252;11 while(scanf("%d%d%d%d",&p,&e,&i,&d),p!=-1)12 {13 int n = (5544*p+14421*e+1288*i)%lcd;14 if(n<=d) n+=lcd;15 printf("Case %d: the next triple peak occurs in %d days.\n",Case,n-d);16 Case++;17 }18 return 0;19 }