pat1011World Cup Betting (20)
2015-10-02 19:29
295 查看
题意分析:
(1)水题,采取边输入betting information边记录当前的best bet以及最高赔率
可能坑点:
(1)注意保留两位小数。
(1)水题,采取边输入betting information边记录当前的best bet以及最高赔率
可能坑点:
(1)注意保留两位小数。
#include <iostream> #include <iomanip> #include <stdio.h> using namespace std; int main() { double odds[3]; int i=0; double product=1,max=0; int tag; while(i<3) { cin>>odds[0]>>odds[1]; if(odds[1]>odds[0]) { max=odds[1]; tag=1; } else { max=odds[0]; tag=0; } cin>>odds[2]; if(odds[2]>max) { max=odds[2]; tag=2; } if(tag==0)cout<<"W "; else if(tag==1)cout<<"T "; else cout<<"L "; product*=max; max=0; i++; } cout<<setiosflags(ios::fixed)<<setprecision(2)<<(product*0.65-1)*2<<endl; //printf("%.2f\n",(product*0.65-1)*2); return 0; }
相关文章推荐
- 还是要动手写博客
- CentOS构造SNMP
- [Sqlite]-->Java采用jdbc联系Sqlite各种特定的工艺数据库的数据操作
- 我眼中的科研
- LeetCode题解:Restore IP Addresses
- HttpClient实现网络访问详解1
- Hiho 1232 北京网络赛 F Couple Trees
- LeetCode题解:Reverse Linked List II
- 虚拟继承
- POJ-1509
- 靠谱的iOS面试题(上)
- JAVA的文件操作
- 安卓控件使用系列16:ImageView实现图片缩放和旋转
- http://www.aboutyun.com/blog-61-62.html
- R Markdown Review
- JAVA的IO处理
- java的集合类
- REST API基本原理理解
- Hdu 4681 2013 Multi-University Training Contest 8 String
- HDU-3374