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 ...
随机推荐
- SNMP协议利用
1.安装snmp服务 2.配置snmp服务 运行Services.msc 添加社区public,只读 启动服务 3.在kali运行 Snmpwalk -c public -v 2c IP 即可查看目标 ...
- 【13】python time时间模块知识点备查
表示时间的三种形式 # 时间模块 '''UTC(世界协调时间):格林尼治天文时间,世界标准时间,在中国来说是UTC+8DST(夏令时):是一种节约能源而人为规定时间制度,在夏季调快1个小时 时间的表示 ...
- Servlet 核心接口
在Servlet体系结构中,除了用于实现Servlet的Servlet接口.GenericServlet类和HttpServlet类外,还有一些辅助Servlet获取相关资源信息的重要接口,了解这些接 ...
- 6.Solr4.10.3API使用(CURD)
转载请出自出处:http://www.cnblogs.com/hd3013779515/ 1.在工程中引入solr-solrj-4.10.3.jar <dependency> <gr ...
- 2-3 R语言基础 矩阵和数组
#矩阵Matrix 三个参数:内容(可省),行数,列数 > x <- matrix(1:6,nrow = 3,ncol = 2) #第一个是内容,第二个,第三个是行列> x[1,2 ...
- BZOJ3473:字符串(后缀数组,主席树,二分,ST表)
Description 给定n个字符串,询问每个字符串有多少子串(不包括空串)是所有n个字符串中至少k个字符串的子串? Input 第一行两个整数n,k. 接下来n行每行一个字符串. Output 一 ...
- 【洛谷】【单调栈】P1901 发射站
[题目描述:] 某地有 N 个能量发射站排成一行,每个发射站 i 都有不相同的高度 Hi,并能向两边(当 然两端的只能向一边)同时发射能量值为 Vi 的能量,并且发出的能量只被两边最近的且比 它高的发 ...
- php 导出导入excel
首先需要去官网https://github.com/PHPOffice/PHPExcel/下载PHPExcel,下载后只需要Classes目录下的文件即可. 链接: https://pan.baidu ...
- php无限分类 下拉框
无限分类 下拉框优势:填写参数少,只需要指定一个循环节点($parnent_id),就可以循环所有下级分类.循环输出结构很有特色,比较符合我的口味.补充: $parent_id才是上下级关联的节点,i ...
- Vue入门2
欢迎转载,转载请注明出处. 前言 学习本系列Vue知识,需要结合本系列的一些demo.你可以查看我的 Github 或者直接下载 ZIP包 . 建议学习本系列之前已经会一个其他的前端框架,了解计算属性 ...