#include <stdio.h>
#include <stdlib.h>
double pi = 3.1415926535898;
int main(int argc, char *argv[])
{
int p, e, i, d;
int k1, k2, k3;
int days;
int cnt = 1;
while (true)
{
scanf("%d %d %d %d", &p, &e, &i, &d);
if (p==-1 && e==-1 && i==-1 && d==-1)
break;
p = p % 23;
e = e % 28;
i = i % 33;
k1 = k2 = k3 = 0;
days = (5544 * p + 14421 * e + 1288 * i - d) % (21252);
if (days <= 0) {
days = 23 * 28 * 33 + days;
}
printf("Case %d: the next triple peak occurs in %d days.\n", cnt++, days);
}
return 0;
}
分享到:
相关推荐
北大POJ1006-Biorhythms【中国剩余定理】 解题报告+AC代码
Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53539 Accepted: 15282 Description Some people believe that there are three cycles in a person's life that start the day he or ...
行业教育软件-学习软件-软件下载_学习软件_电脑学习_Natural Biorhythms 3.031免费下载.zip
显示您与出生日期的照片墙(BioRhythms和所有那个...)的兼容性。百分;) 是的,不要忘记在设置中指定出生日期。 阅读更多关于Wiki或http://cmpati.me 愉快的使用! :) 用于搜索的标签:Fotostrana,BioRhythms,...
生物节律将在Cleve's Corner博客版中进行讨论。 请参阅http://blogs.mathworks.com/cleve/biorhythms 。
小的 在这发个代码呵呵 北大ACM的1006题答案呵呵 帮助菜鸟啊呵呵
1160 Biorhythms 简单题 1163 The Staircases 简单题 1177 K-Magic Number 简单题 1184 Counterfeit Dollar 简单题 1182 Keeps Going and Going and ... 简单题,我喜欢:) 1284 Perfection 简单题 1272 ...
1160 Biorhythms 简单题 1163 The Staircases 简单题 1177 K-Magic Number 简单题 1184 Counterfeit Dollar 简单题 1182 Keeps Going and Going and ... 简单题,我喜欢:) 1284 Perfection 简单题 1272 ...