pku 1006 中國剩餘定理

#include<iostream>
using namespace std;
int main()
{ int p,e,i,d,a,t=0;
 while(1)
 {
  cin>>p>>e>>i>>d;
  if(p==-1 && e==-1 && i==-1 && d==-1)
   break;
  a=(5544*p+14421*e+1288*i-d+21252)%21252;
  if(!a)
   a=21252;
  ++t;
  cout<<"Case "<<t<<": the next triple peak occurs in "<<a<<" days.\n";
 }
 return 0;
}
 
 
中國剩餘定理了
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章