英语真差劲啊,看题目没看明白,无奈重新开始手抄题目,突然发现一句话 “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(22)总结下最近遇到的编码问题

    最近爬取,或者解析网页是总是遇到编码问题(我的版本:python2.7) 一.常见异常:UnicodeEncodeError: 'ascii' codec can't encode character ...

  2. android之location02

    package com.example.mars_3300_location02; import java.net.ContentHandler; import java.util.List; imp ...

  3. android之datepicker控件用法

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  4. 无法向会话状态服务器发出会话状态请求请。确保 ASP.NET State Service (ASP.NET 状态服务)已启动

    原文链接:http://www.cnblogs.com/IT-Bear/archive/2012/01/04/2311546.html 无法向会话状态服务器发出会话状态请求.请确保 ASP.NET S ...

  5. [ActionScript 3.0] AS3 Socket安全沙箱策略文件

    当与一个主机建立一个Socket连接时,Flash Player要遵守如下安全沙箱规则: 1.Flash的.swf文件和主机必须严格的在同一个域名,只有这样才可以成功建立连接: 2.一个从网上发布的. ...

  6. 华硕X84L无线驱动查找

    打开官网:http://www.asus.com.cn/ 点击导航栏的服务与支持 产品型号识别http://www.asus.com.cn/support/Article/565/ 我的是:X84L  ...

  7. nyoj 70 阶乘因式分解(二)

    点击打开链接 阶乘因式分解(二) 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 给定两个数n,m,其中m是一个素数. 将n(0<=n<=2^31)的阶乘分解 ...

  8. Oracle Dataguard Standby Redo Log的两个实验

    在Data Guard环境中,Standby Redo Log是一个比较特殊的日志类型.从最新的DG安装指导中,都推荐在Primary和Standby端,都配置Standby Redo Log. 简单 ...

  9. oracle参数open_cursors和session_cached_cursor详解!

    SQL> show parameter open_cursors           --每个session(会话)最多能同时打开多少个cursor(游标) NAME               ...

  10. Android Activity 详述

    activity类处于android.app包中,继承关系: extends ContextThemeWrapper implements LayoutInflater.Factory2 Window ...