题目链接:http://poj.org/problem?id=1006

解题报告:

1、枚举天数的时候可以根据前面的结果直接跳过一些错误的答案。

///三个周期是23,28,33,
#include <stdio.h> int main()
{
int p,e,i,d,Case=;
while(scanf("%d%d%d%d",&p,&e,&i,&d),p!=-)
{
int t1=p%,t2=e%,t3=i%;///三个周期第一次出现的时间
int day;
for(day=d+;day<=;day++)
{
if((day-t1)%==)
break;
}
for(;day<=;day+=)
{
if((day-t2)%==)
break;
}
for(;day<=;day+=*)
{
if((day-t3)%==)
break;
}
printf("Case %d: the next triple peak occurs in %d days.\n",Case,day-d);
Case++;
}
return ;
}

生理周期,POJ(1006)的更多相关文章

  1. 生理周期POJ 1006

    Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 138101   Accepted: 44225 Description 人生 ...

  2. POJ 1006 生理周期(中国剩余定理)

    POJ 1006 生理周期 分析:中国剩余定理(注意结果要大于d即可) 代码: #include<iostream> #include<cstdio> using namesp ...

  3. [POJ 1006]生理周期

    Description 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这天,人会在相应的方面表现出色.例如,智力周期的高峰 ...

  4. POJ 1006 生理周期【数论】

    这题是有中文版的(右上角选项卡里把default改成简体中文)然后看到他把biorhythms翻成生理周期我可耻的笑了......23333 如果没有限定从日期d开始,完全可以从第一天起开始计时,因此 ...

  5. poj——1006 生理周期

    生理周期 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 138291   Accepted: 44300 Descripti ...

  6. POJ 1006 - Biorhythms (中国剩余定理)

    B - Biorhythms Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Subm ...

  7. poj 1006 Biorhythms (中国剩余定理模板)

    http://poj.org/problem?id=1006 题目大意: 人生来就有三个生理周期,分别为体力.感情和智力周期,它们的周期长度为23天.28天和33天.每一个周期中有一天是高峰.在高峰这 ...

  8. [POJ 1006] Biorhythms C++解题

        Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 107569   Accepted: 33365 ...

  9. poj 1006:Biorhythms(水题,经典题,中国剩余定理)

    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Des ...

  10. 生理周期[PKU1006]

    生理周期 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 132195   Accepted: 42171 Descripti ...

随机推荐

  1. java多线程-Thread

    大纲 sleep yield join setDaemon sleep: public static native void sleep(long millis) throws Interrupted ...

  2. Json 序列化为Dictionary

    如下所示的json字符串中包含中文属性转换成英文属性 ["sid":"dd1312","success":true,"data&q ...

  3. android主线程ActivityThread

    ActivityThread在Android中它就代表了Android的主线程,但是并不是一个Thread类. 源码如下: http://androidxref.com/6.0.0_r1/xref/f ...

  4. spring cloud 之 Feign的使用

    1.添加依赖 2.创建FeignClient 原理:Spring Cloud应用在启动时,Feign会扫描标有@FeignClient注解的接口,生成代理,并注册到Spring容器中.生成代理时Fei ...

  5. 最近准备把安卓和java的知识再回顾一遍,顺便会写博客上!千变万化还都是源于基础,打扎实基础

    最近准备把安卓和java的知识再回顾一遍,顺便会写博客上!千变万化还都是源于基础,打扎实基础,加油吧 距离去北京还有23天

  6. Visual Studio 创建封装自己的代码段(C#)

    https://www.cnblogs.com/awaTangjay/p/6644952.html 1.打开vs2012--工具--代码段管理器 2.进入代码管理器之后,语言选择Visual C#,然 ...

  7. Oracle服务器重命名

    转载自:http://www.codesec.net/view/120387.html 因工作需要准备了一台服务器专门按照oracle数据库,并且服务器上安装了windows 2008R2操作系统,在 ...

  8. FZU 1924——死锁——————【topo判环】

    死锁 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Pr ...

  9. 5、Angular2 Injectable 服务

    1.Injectable 

  10. js判断下拉框改变状态

    <script> $('#questSort').change(function(){ //此处写状态改变要实现的功能 var s=$('#questSort').children('op ...