poj-2707
来源:互联网 发布:杨幂的脸要塌了 知乎 编辑:程序博客网 时间:2024/06/05 20:01
//408K 0MS G++#include <cstdio>#include <cstring>using namespace std;int oX;int oY;int dX;int dY;inline double MIN(double a, double b) { return a < b ? a: b;}inline double MAX(double a, double b) { return a > b ? a: b;}void solve(int ox, int oy, int dx, int dy) { double case1x = (dx >= ox) ? 1.0 : (double)dx/ox; double case1y = (dy >= oy) ? 1.0 : (double)dy/oy; double case1 = MIN(case1x, case1y); double case2x = (dy >= ox) ? 1.0 : (double)dy/ox; double case2y = (dx >= oy) ? 1.0 : (double)dx/oy; double case2 = MIN(case2x, case2y); printf("%d%%\n", (int)(MAX(case1, case2)*100));}int main() { while(scanf("%d %d %d %d", &oX, &oY, &dX, &dY) != EOF) { if (!oX && !oY && !dX && !dY) { return 0; } solve(oX, oY, dX, dY); }}
水水更健康,就两种放法,找最大的就可以,这道题不能四舍五入。
0 0
- POJ 2707
- poj-2707
- POJ 2707 Copier Reduction
- POJ 2707 水题,输入输出
- poj 2707 Copier Reduction
- Poj 2707 Copier Reduction
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- 软件开发从业人员必读的五本书
- VS2013显示行号及显示程序汇编代码
- 黑马程序员---------java 基础知识复习(foreach、Arrays、String、StringBuffer、容器类)
- android平台蓝牙编程
- [c#.net]做tooltip给控件动态添加属性的做法、IExtenderProvider接口的使用
- poj-2707
- 用程序命名多个文件 字符串+数字的类型
- 参数传递----C里面只有值传递
- WPF与Prism一并学习(四)
- java垃圾回收机制
- 深入java面向对象二:final关键字
- QML类型说明-InnerShadow
- android的全屏和屏幕高宽的获取
- LINUX下多路径(multi-path)介绍及使用 【转载】