英语真差劲啊,看题目没看明白,无奈重新开始手抄题目,突然发现一句话 “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. http 303 307 302 状态码理解

    最近在看 <<the rails4 way>> 书中提到了这几个状态码,网上搜到几篇文章 http://www.cnblogs.com/cswuyg/p/3871976.htm ...

  2. win xp32位与64位怎么查看是多少位系统

    方法一: Windows XP/Server2003几乎都是32位的操作系统 1. 单击“开始”,然后单击“运行”. 2. 在“打开”框中,键入cmd(再键入systeminfo)或者winmsd.e ...

  3. SqlServer中的更新锁(UPDLOCK)

    UPDLOCK.UPDLOCK 的优点是允许您读取数据(不阻塞其它事务)并在以后更新数据,同时确保自从上次读取数据后数据没有被更改.当我们用UPDLOCK来读取记录时可以对取到的记录加上更新锁,从而加 ...

  4. gc 辅助打印信息

    cat xx.xml|grep GC <jvm-arg>-XX:+PrintGCDetails</jvm-arg> <jvm-arg>-XX:+PrintGCDat ...

  5. poj 1125 Stockbroker Grapevine dijkstra算法实现最短路径

    点击打开链接 Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23760   Ac ...

  6. Hadoop修改SSH端口号

    hadoop-env.sh export HADOOP_SSH_OPTS="-p 16022"

  7. OC基础(22)

    NSMutableString基本概念 NSMutableString常用方法 NSMutableString练习 *:first-child { margin-top: 0 !important; ...

  8. Centos 时间同步服务器

    From: http://www.iteye.com/topic/599648 中国国家授时中心: http://www.time.ac.cn/stime.asp 其他网络时间服务器地址如下:(也可以 ...

  9. Bootstrap 3 How-To #1 下载与配置

    Bootstrap 3 发布了,通过简单的几步,我们就可以使用 Bootstrap 的样式表,图标,以及 javascript 来配置一个简单的站点. 准备 Bootstrap 不仅仅是一个代码集,还 ...

  10. android 解决ScrollView嵌套ListView的问题,不能全屏,全屏不能显示下面控件

    在开发中遇到ScrollView嵌套ListView的问题,最开始发出不能全屏,效果是这样的: 但我想要的效果是这样的: 下面看一下布局文件: <?xml version="1.0&q ...