【PAT甲级】1011 World Cup Betting (20 分)
题意:
给出三组小数,每组三个,分别代表一场比赛下注一块钱胜平负的赔率。输出投注的方案并计算投注两块钱期望收获。(赔率相乘后乘上0.65再减去本金2块钱)
AAAAAccepted code:
#include<bits/stdc++.h>
using namespace std;
double a[][];
double mx[];
int pos[];
int main(){
for(int i=;i<=;++i)
for(int j=;j<=;++j){
cin>>a[i][j];
if(a[i][j]>mx[i]){
mx[i]=a[i][j];
pos[i]=j;
}
}
for(int i=;i<=;++i){
if(pos[i]==)
cout<<"W"<<" ";
else if(pos[i]==)
cout<<"T"<<" ";
else if(pos[i]==)
cout<<"L"<<" ";
}
double ans=(mx[]*mx[]*mx[])*0.65*2.0-2.0;
printf("%.2f",ans);
return ;
}
【PAT甲级】1011 World Cup Betting (20 分)的更多相关文章
- 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)(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)(代码+思路)
1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...
- PAT Advanced 1011 World Cup Betting (20 分)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...
- 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甲 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
PATA1011 World Cup Betting With the 2010 FIFA World Cup running, football fans the world over were b ...
- 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 1011 World Cup Betting (20分) 比较大小难度级别
题目 With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly exc ...
随机推荐
- (爬虫)随机生成一个header
#!/usr/bin/env python #-*- coding: utf-8 -*- #__Author__: yunrui #__Version__: 1.0 #__Time__: 2019/1 ...
- GBK与Unicode的转换
一.GBK转换到Unicode编码 std::string Gbk2Unicode(std::string &strValue) { std::string strReturn; unsign ...
- Centos6.10-FastDFS-Storage.conf配置示例
Centos610系列配置 # is this config file disabled # false for enabled # true for disabled disabled = fals ...
- AtCoder AGC038 C-LCMs 题解
题目链接:https://agc038.contest.atcoder.jp/tasks/agc038_c?lang=en 题意:给定一个数组,求这个数组中所有数对的LCM之和. 分析:网上看到了很多 ...
- iOS多线程编程的知识梳理
多线程编程也称之为并发编程,由于其作用大,有比较多的理论知识,因此在面试中也是受到面试官的青睐.在日常项目开发中,至少网络请求上是需要使用到多线程知识的,虽然使用第三方的框架比如AFNetworkin ...
- Cosmetic Airless Bottles To Meet Practical Requirements
Today, people use cosmetic bottles, many of which are in cosmetic airless bottles. We can use them, ...
- Springboot项目搭建(2)-整合静态文件
1,引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId> ...
- 外置ADC
美信关于如何简化微控制器与温度传感器的接口设计?: 一般外置ADC与单片机UC之间通过SPI或SMBUS接口通信 当IO口比较紧张时可以选择脉冲或频率方波正比与测量值输出的外置ADC,此时也可以实现光 ...
- iOS 开发之基于JWT的Token认证机制及解析
在移动端和服务端通信中,一般有两种认证方式:token 和 session. 1.session/cookie 认证机制: 在服务端创建一个Session对象,同时在客户端的浏览器端创建一个Cooki ...
- sockfd_to_family函数
#include <sys/socket.h> #include <netinet/in.h> #define SA struct sockaddr int sockfd_to ...