第8章例题--生理周期--2977
2011-12-15 15:10
169 查看
#include <iostream> #include <stdio.h> #include <string.h> #include <math.h> #include <algorithm> #include <string> #include <vector> #include <list> using namespace std; int main() { int p,e,i,d; int num, j; num = 0 ; while(scanf("%d %d %d %d",&p,&e,&i,&d) && !( p == -1 && e == -1 && i == -1 && d == -1 )) { num ++ ; for ( j = d + 1 ; j < 21252 ; j ++ ) if( (j - p) % 23 == 0 ) break ; for( ; j < 21252 ; j = j + 23 ) if( (j - e) % 28 == 0 ) break ; for( ; j < 21252 ; j = j + 23 * 28 ) if( (j - i) % 33 == 0 ) break; printf("Case %d: the next triple peak occurs in %d days.\n", num , j - d ); } return 1; }
相关文章推荐
- POJ 2977 生理周期 解题报告
- POJ 2977 生理周期 解题报告
- 2977:生理周期(枚举)
- 第一周 枚举 例题3.生理周期
- 生理周期
- 简单枚举的例子:生理周期
- 九度OJ 1142:Biorhythms(生理周期) (中国剩余定理)
- poj 1006 生理周期 中国剩余定理
- POJ 1006 生理周期
- 九度OJ 1142:Biorhythms(生理周期) (中国剩余定理)
- MOOC 生理周期
- POJ:1006--BIORHYTHM(生理周期计算)
- 枚举——最佳生理周期
- poj 1006 生理周期 【中国剩余定理】
- 生理周期计算
- POJ 1006 Biorhythms 生理周期 水题
- POJ1006生理周期----【模板】CRT中国剩余定理即孙子定理即求解一次同余方程
- 中国剩余定理算法详解 + POJ 1006 Biorhythms 生理周期
- 枚举举例,生理周期
- poj1006-生理周期-中国剩余定理