PAT甲题题解-1011. World Cup Betting (20)-误导人的水题。。。
题目不严谨啊啊啊啊
式子算出来结果是37.975
样例输出的是37.98
我以为是四舍五入的啊啊啊,所以最后输出的是sum+0.005
结果告诉我全部错误啊
结果直接保留两位小数就可以了啊啊啊啊
水题也不要这么坑人啊啊啊啊
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring> using namespace std;
int main()
{
double a[];
double sum=1.0;
for(int i=;i<;i++){
scanf("%lf %lf %lf",&a[],&a[],&a[]);
//printf("%lf %lf %lf\n",a[0],a[1],a[2]);
if(a[]>=a[] && a[]>=a[]){
printf("W ");
sum*=a[];
}
else if(a[]>=a[] && a[]>=a[]){
printf("T ");
sum*=a[];
}
else{
printf("L ");
sum*=a[];
}
}
sum=(sum*0.65-)*;
printf("%.2lf\n",sum);
return ;
}
PAT甲题题解-1011. World Cup Betting (20)-误导人的水题。。。的更多相关文章
- PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642
PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642 题目描述: With the 2010 FIFA World Cu ...
- PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) (找最值)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...
- 【PAT Advanced Level】1011. World Cup Betting (20)
简单模拟题,遍历一遍即可.考察输入输出. #include <iostream> #include <string> #include <stdio.h> #inc ...
- PAT甲 1011. World Cup Betting (20) 2016-09-09 23:06 18人阅读 评论(0) 收藏
1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...
- PAT 甲级 1011 World Cup Betting (20)(20 分)(水题,不用特别在乎精度)
1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...
- PAT 甲级 1011 World Cup Betting (20)(20 分)
1011 World Cup Betting (20)(20 分)提问 With the 2010 FIFA World Cup running, football fans the world ov ...
- PAT 甲级 1011 World Cup Betting (20)(代码+思路)
1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...
- PATA 1011 World Cup Betting (20)
1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...
- PAT Advanced 1011 World Cup Betting (20 分)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...
随机推荐
- 自己写的开源MVC-easyMVC分享
简介 基本风格是按照spring mvc做的,在后期会加入一些新的特性,封装成易于自己项目使用的mvc框架. github地址: https://github.com/tangyanbo/easymv ...
- js 毫秒转换为标准时间
function dateForm(time){ var unixTimestamp = new Date( 1477386005*1000 ); commonTime = unixTimestamp ...
- 【洛谷】【单调队列】P2032 扫描
[题目描述:] 有一个 1 ∗ n 的矩阵,有 n 个正整数. 现在给你一个可以盖住连续的 k 的数的木板. 一开始木板盖住了矩阵的第 1 ∼ k 个数,每次将木板向右移动一个单位,直到右端与第 n ...
- 【转】ajax 跨域 headers JavaScript ajax 跨域请求 +设置headers 实践
解决跨域调用服务并设置headers 主要的解决方法需要通过服务器端设置响应头.正确响应options请求,正确设置 JavaScript端需要设置的headers信息 方能实现. 此处手札 供后人参 ...
- Unicode,ISO-8859-1,GBK,UTF-8编码及相互转换(转载)
第二篇:JAVA字符编码系列二:Unicode,ISO-8859-1,GBK,UTF-8编码及相互转换 1.函数介绍在Java中,字符串用统一的Unicode编码,每个字符占用两个字节,与编码有关的两 ...
- 连接远程数据库ORACLE11g,错误百出!
客户机中PLSQL DEV访问虚拟机中的ORACLE11g,错误百出! 创建时间: 2017/10/14 18:44 作者: CNSIMO 标签: ORACLE 忙了一下午,只有两个字形容:麻烦! ...
- pytorch代码资源
pytorch版本的faster和fpn https://github.com/jwyang/faster-rcnn.pytorch https://github.com/jwyang/fpn.pyt ...
- WorldWind源码剖析系列:星球类World
星球类World代表通用的星球类,因为可能需要绘制除地球之外的其它星球,如月球.火星等.该类的类图如下. 需要说明的是,在WorldWind中星球球体的渲染和经纬网格的渲染时分别绘制的.经纬网格的渲染 ...
- WorldWind源码剖析系列:影像存储类ImageStore、Nlt影像存储类NltImageStore和WMS影像存储类WmsImageStore
影像存储类ImageStore 影像存储类ImageStore提供了计算本地影像路径和远程影像影像URL访问的各种接口,是WmsImageStore类和NltImageStore类的基类.当划分完层次 ...
- 使用 zTree 右键菜单功能的总结
一: 首先什么是zTree? zTree 是一个依靠 jQuery 实现的多功能 “树插件”.优异的性能.灵活的配置.多种功能的组合是 zTree 最大优点.专门适合项目开发,尤其是 树状菜单.树状 ...