0%

PAT-1011 World Cup Betting

1011 World Cup Betting

题意

根据分数计算规则计算得分

思路

简单

源码

line_number: true
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <stdio.h>
#include <map>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
using namespace std;
char szGameResult[3] = {'W', 'T', 'L'};
int main()
{
double fRadio = 1;
for(int i = 0; i < 3; i++)
{
double maxGameRadio = 0;
double fGameRadio;
int iGameRadioIndex = 0;
for(int j = 0; j < 3; j++)
{
cin>> fGameRadio;
if(fGameRadio > maxGameRadio)
{
maxGameRadio = fGameRadio;
iGameRadioIndex = j;
}
}
cout<< szGameResult[iGameRadioIndex] << " ";
fRadio *= maxGameRadio;
}
double fBet = (fRadio * 0.65 - 1) * 2;
printf("%.2f\n", fBet);
return 0;
}