online_judge_1142
来源:互联网 发布:电脑自动化办公软件 编辑:程序博客网 时间:2024/05/04 20:01
#include <iostream>using namespace std;int main(){ int p, e, i, d; int cnt,k; cnt = 1; while(cin>>p>>e>>i>>d) { if(p==-1 && e == -1 && i == -1 && d == -1) break; for(k=0;k<d;++k) { p = (p==0 ? 22 : p-1); e = (e==0 ? 27 : e-1); i = (i==0 ? 32 : i-1); } for(k=0;k<21252;++k) { p = (p==0 ? 22 : p-1); e = (e==0 ? 27 : e-1); i = (i==0 ? 32 : i-1); if(p==0 && e==0 && i==0) { break; } } cout<<"Case "<<cnt++<<": the next triple peak occurs in "<<k+1<<" days."<<endl; } return 0;}
这个题目我做的很烂。。真正的意义是去弄清楚中国剩余定理。。数论中的知识,可以避免像我这样死算……
0 0
- online_judge_1142
- labe 高度根据内容的自适应
- discuz mysql 错误 (1045) notconnect
- 制作血条
- 151223怎么去掉Xcode工程中的某种类型的警告 Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to
- writing idiomatic python 读书笔记(1)
- online_judge_1142
- Mysql 查看定时器 打开定时器 设置定时器时间
- 你没有变强,是因为你一直很舒服
- 第三天 绘制数字
- POJ 2392 简单dp 多重背包
- 安卓开发笔记(二)------------终止一个线程
- 重载运算符
- Android PopupWindow的封装使用
- linux用户管理(创建修改删除用户、用户组,修改密码,)