【PAT Advanced Level】1011. World Cup Betting (20)
简单模拟题,遍历一遍即可。考察输入输出。
#include <iostream>
#include <string>
#include <stdio.h>
#include <iomanip>
using namespace std;
#define N 3
int main()
{
char res[3]={'W','T','L'};
char max_res[N];
int i,j;
float tmp,sum=1,odd;
for(i=0;i<N;i++){
tmp=0;
for(j=0;j<3;j++){
cin>>odd;
if(odd>tmp){
tmp=odd;
max_res[i]=res[j];
}
}
sum*=tmp;
}
sum=(sum*0.65-1)*2;
for(i=0;i<N;i++)
cout<<max_res[i]<<" ";
cout<<fixed<<setprecision(2)<<sum<<endl;
//printf("%.2f",sum+0.005);
return 0;
}
【PAT Advanced Level】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】1008. Elevator (20)
没什么难的,简单模拟题 #include <iostream> using namespace std; int main() { int num; cin>>num; int ...
- 【PAT Advanced Level】1004. Counting Leaves (30)
利用广度优先搜索,找出每层的叶子节点的个数. #include <iostream> #include <vector> #include <queue> #inc ...
- 【PAT Advanced Level】1006. Sign In and Sign Out (25)
关键在于清空字符数组和使用scanf进行输入 #include <stdio.h> #include <string.h> #include <fstream> # ...
- 【PAT Advanced Level】1014. Waiting in Line (30)
简单模拟题,注意读懂题意就行 #include <iostream> #include <queue> using namespace std; #define CUSTOME ...
- 【PAT Advanced Level】1015. Reversible Primes (20)
转换进制&&逆序可以在一起进行,有一点技巧,不要用十进制数来表示低进制,容易溢出. #include <iostream> #include <vector> ...
- 【PAT Advanced Level】1013. Battle Over Cities (25)
这题给定了一个图,我用DFS的思想,来求出在图中去掉某个点后还剩几个相互独立的区域(连通子图). 在DFS中,每遇到一个未访问的点,则对他进行深搜,把它能访问到的所有点标记为已访问.一共进行了多少次这 ...
- 【PAT甲级】1011 World Cup Betting (20 分)
题意: 给出三组小数,每组三个,分别代表一场比赛下注一块钱胜平负的赔率.输出投注的方案并计算投注两块钱期望收获.(赔率相乘后乘上0.65再减去本金2块钱) AAAAAccepted code: #in ...
随机推荐
- java把html标签字符转换成普通字符(反转换成html标签)
package net.jasonjiang.web; import org.junit.Test; import org.springframework.web.util.HtmlUtils; /* ...
- 使用chrales抓包IOS的https(pc+手机)
1.安装SSL证书到手机 点击 Help -> SSL Proxying -> Install Charles Root Certificate on a Mobile Device 2. ...
- 【*】Redis常见问题汇总
1.什么是Redis? Redis是一个开源.高性能.基于键值对的缓存与存储系统. 2.Redis相比memcached有哪些优势? 劣势:Redis是单线程,Memcached是多线程,在多核服务器 ...
- 机器学习:KNN-近邻算法
一.理论知识 1.K近邻(k-Nearest Neighbor,简称KNN)学习是一种常用的监督学习. 工作机制:给定测试样本,基于某种距离度量找出训练集中与其最靠近的k个训练样本,然后基于这k个的信 ...
- eNSP仿真学习和VLAN配置
路由&交换机基本命令 sys #切换到系统视图(修改配置),Ctrl+Z 返回用户视图 sysname SW1 #设备重命名为SW1 int g0/0/1 #进入接口视图 VLAN配置 首先连 ...
- Android IntentService
IntentService简要分析 IntentService 继承自 android.app.Service.内部实现极其简单. 首先在 onCreate()中去开启了一个 HandlerThrea ...
- 一台电脑如何安装多个版本的JDK
1 . 准备两个版本的jdk我的两个jdk路径为: C:\Program Files\Java\jdk1.6.0_43 C:\Program Files\Java\jdk1.8.0_25 2 . ...
- 【WIN10】VisualStateManager使用說明
Demo下載:http://yunpan.cn/cFjgPtWRHKH9H 访问密码 c4b7 顧名思義,視圖狀態管理器. 在WPF中,它的功能似乎更強大.在UWP中,閹割了GotElementSt ...
- hihocoder 1509 异或排序
题面在这里! 考虑前后两个数 x,y,可以发现S只有在(x xor y)的最高有1位上的取值是要被确定的 (如果x==y那么没有限制),可以推一下什么情况下是1/0. 于是我们模拟一下这个操作,判一判 ...
- C#高级编程9-第1章.NET体系结构
C#与NET的关系 C#编写的所有代码必须使用.NET FrameWork运行 C#是一种语言,但它本身不是.NET的一部分 C#一些特性,.NET不支持,.NET一些特性,C#不支持 公共语言运行库 ...