简单模拟题,遍历一遍即可。考察输入输出。

#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)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 【PAT Advanced Level】1008. Elevator (20)

    没什么难的,简单模拟题 #include <iostream> using namespace std; int main() { int num; cin>>num; int ...

  4. 【PAT Advanced Level】1004. Counting Leaves (30)

    利用广度优先搜索,找出每层的叶子节点的个数. #include <iostream> #include <vector> #include <queue> #inc ...

  5. 【PAT Advanced Level】1006. Sign In and Sign Out (25)

    关键在于清空字符数组和使用scanf进行输入 #include <stdio.h> #include <string.h> #include <fstream> # ...

  6. 【PAT Advanced Level】1014. Waiting in Line (30)

    简单模拟题,注意读懂题意就行 #include <iostream> #include <queue> using namespace std; #define CUSTOME ...

  7. 【PAT Advanced Level】1015. Reversible Primes (20)

    转换进制&&逆序可以在一起进行,有一点技巧,不要用十进制数来表示低进制,容易溢出. #include <iostream> #include <vector> ...

  8. 【PAT Advanced Level】1013. Battle Over Cities (25)

    这题给定了一个图,我用DFS的思想,来求出在图中去掉某个点后还剩几个相互独立的区域(连通子图). 在DFS中,每遇到一个未访问的点,则对他进行深搜,把它能访问到的所有点标记为已访问.一共进行了多少次这 ...

  9. 【PAT甲级】1011 World Cup Betting (20 分)

    题意: 给出三组小数,每组三个,分别代表一场比赛下注一块钱胜平负的赔率.输出投注的方案并计算投注两块钱期望收获.(赔率相乘后乘上0.65再减去本金2块钱) AAAAAccepted code: #in ...

随机推荐

  1. CF582A GCD Table

    A. GCD Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  2. sqlldr errors

    sqlldr myUser/myPWD@myCONN control='d:/sqlload/new/test/loader1.ctl' errors=1000000

  3. python 自带的range是不能实现对小数的操作的,如果要对小数操作可以使用numpy

    import numpy as np s = np.arange(0, 1, 0.1) print s [0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]

  4. python的可变与不可变数据类型

    <python的可变与不可变数据类型>     python与C/C++不一样,它的变量使用有自己的特点,当初学python的时候,一定要记住“一切皆为对象,一切皆为对象的引用”这句话,其 ...

  5. 决策树算法(ID3)

    Day Outlook Temperature Humidity Wind PlayTennis 1 Sunny Hot High Weak No 2 Sunny Hot High Strong No ...

  6. wpf企业应用之数据校验

    wpf中使用IDataErrorInfo实现数据校验,绑定实体需要实现了此接口,并在UI绑定表达式中添加ValidatesOnDataErrors=True,这样数据校验发生时,wpf会调用该接口中的 ...

  7. bestcoder#23 1002 Sequence II 树状数组+DP

    Sequence II Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  8. Codeforces Round #280 (Div. 2) E. Vanya and Field 思维题

    E. Vanya and Field time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  9. wikioi 1294 全排列 dfs

    1294 全排列 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold       题目描述 Description 给出一个n, 请输出n的所有全排列 输入描述 Inpu ...

  10. spring---transaction(2)---源代码分析(事务的定义TransactionDefinition)

    写在前面 事务属性通过TransactionDefinition接口实现定义,主要有事务隔离级别.事务传播行为.事务超时时间.事务是否只读. public interface TransactionD ...