poj1006_Biorhythms
英语真差劲啊,看题目没看明白,无奈重新开始手抄题目,突然发现一句话 “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的更多相关文章
随机推荐
- [复变函数]第15堂课 4.3 解析函数的 Taylor 展式
1. Taylor 定理: 设 $f(z)$ 在 $K:|z-a|<R$ 内解析, 则 $$\bee\label{15:taylor} f(z)=\sum_{n=0}^\infty c_n(z ...
- centos下yum安装wget失败
执行了yum -y install wget后得到下面的提示 Failed to set locale, defaulting to C Loaded plugins: fastestmirror L ...
- spring外部化配置
例如 <bean id="dataSource" class="....." p:username="aa" p:password=& ...
- Linux系统时间设置(转载)
Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟.系统时钟是指当前Linux Kernel中的时钟,而硬件时钟则是主板上由电池供电的时钟, ...
- RightBarButon
//rightBar button UIButton *rightButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 34, 34)]; ...
- Python中用datetime包进行对时间的一些操作
1. 计算给出两个时间之间的时间差 import datetime as dt # current time cur_time = dt.datetime.today() # one day pre_ ...
- 玄机论坛Socket类库源码 当前版本 2.6.3 更新日期:10-09/2015 z
http://bbs.msdn5.com/thread-27-1-1.html 本类库采用TcpLister,TcpClient高度封装, 采用NetworkStream进行异步模式读取数据. 采用S ...
- Java高级开发工程师
- 第4章 管道和FIFO
4.1 管道 管道是由pipe函数创建的,提供一个单向数据流. 头文件 #include <unistd.h> 函数原型 int pipe(int fd[2]); 返回值 成功则为0,出错 ...
- 前后台彻底分离的核心文件bridge.js.
具体代码可以在我的git上下载:https://github.com/guoyansi/bridge 这里的后台使用java写的,如果不了解java的童鞋可以忽略下面这样图片. bridge.js / ...