英语真差劲啊,看题目没看明白,无奈重新开始手抄题目,突然发现一句话 “For each cycle,you will be given the number of days form the beginning of the current year at which one of its peaks occurs. " 看到这句才反应过来应该把前三个值分别取余,好笨啊!

 #include <stdio.h>
#include <math.h>
int main(){
int k,i,n,j;
int a,b,c,d;
int cnt=;
while(~scanf("%d%d%d%d",&a,&b,&c,&d)){
if(a==-&&b==-&&c==-&&d==-)
break;
a=a%;b=b%;c=c%;
for(i=;i<=;++i){
if(i<a||i<b||i<c) continue;
if( ((i-a)%==) && ((i-b)%==) && ((i-c)%==) ){
if(d>=i){
printf("Case %d: the next triple peak occurs in %d days.\n",++cnt,i-d+**);
}else
printf("Case %d: the next triple peak occurs in %d days.\n",++cnt,i-d);
break;
}
}
}
return ;
}

poj1006_Biorhythms的更多相关文章

随机推荐

  1. python(5)字符串处理 (sub,replace,find,index,upper,strip,split,sub翻页

    一,sub和replace的用法 re.sub 函数进行以正则表达式为基础的替换工作 re.sub替换到目标字符串中的a,b或者c,并全部替换 另加上sub翻页操作: re.sub('start=\d ...

  2. Mac下配置JAVA_HOME

    http://blog.csdn.net/shallowgrave/article/details/39367119 闲来无事,装个Hbase玩玩,突然发现Mac下默认安装的JDK7,没有配置JAVA ...

  3. ruby 字符串学习2

    在一个ruby字符串中包含表但是或者变量.想使用不同的值替换表达式或者变量 1 类似java 或者python的printf-style方式 template = 'Oceania has alway ...

  4. [ActionScript 3.0] Away3D 旋转效果

    package { import away3d.containers.View3D; import away3d.entities.Mesh; import away3d.events.MouseEv ...

  5. Ecshop 安装时错误

    网上提示方法将install/includes/lib_installer.php以下内容修改后仍然提示失败: include(ROOT_PATH . 'install/languages/' . $ ...

  6. mysql设置定时任务

    –查看时间调度器是否开启 SHOW VARIABLES LIKE 'event_scheduler'; SELECT @@event_scheduler; –开启时间调度器 SET GLOBAL ev ...

  7. ARM的QT phonon 的移植

    Phonon是QT提供的一套多媒体框架,提供多媒体播放图形界面和回放的功能,QT也是通过phonon来实现跨平台的多媒体播放.应用程序不需要关心多媒体播放到底是由什么实现的(如gstreamer.xi ...

  8. The Ninth Hunan Collegiate Programming Contest (2013) Problem A

    Problem A Almost Palindrome Given a line of text, find the longest almost-palindrome substring. A st ...

  9. BZOJ1407_NOI2002_荒岛野人_Savage_C++

    题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1407 题解:http://www.cnblogs.com/hadilo/p/5951091.h ...

  10. 强大的内网劫持框架之MITMf

    Mitmf 是一款用来进行中间人攻击的工具.它可以结合 beef 一起来使用,并利用 beef 强大的 hook 脚本来控制目标客户端.下面让我们一起看看如何在 Kali2.0上安装使用 Mitmf ...