您的位置:首页 > 其它

1011. World Cup Betting (20)

2015-11-04 12:36 495 查看
1.较为简单

2.最后的公式为(a*b*c*0.65-1)*2

//#include<string>
//#include <iomanip>
#include<vector>
#include <algorithm>
//#include<stack>
#include<set>
#include<queue>
#include<map>
//#include<unordered_set>
//#include<unordered_map>
//#include <sstream>
//#include "func.h"
//#include <list>
#include<stdio.h>
#include<iostream>
#include<string>
#include<memory.h>
#include<limits.h>
using namespace std;
int main(void) {
//精度要求,使用double或者float都可以AC
vector<vector<double>> game(3, vector<double>(3, 0));
string s[3] = { "W", "T", "L" };
scanf("%lf %lf %lf %lf %lf %lf %lf %lf %lf", &game[0][0], &game[0][1], &game[0][2], &game[1][0], &game[1][1], &game[1][2], &game[2][0], &game[2][1], &game[2][2]);

double ans[3];
string out[3];
ans[0] = game[0][0];
ans[1] = game[1][0];
ans[2] = game[2][0];
out[0] = s[0];
out[1] = s[0];
out[2] = s[0];
for (int i = 0; i < 3; i++)
{
for (int j = 1; j < 3; j++)
{
if (ans[i] < game[i][j])
{
ans[i] = game[i][j];
out[i] = s[j];
}
}
}
double res = (ans[0] * ans[1] * ans[2] * 0.65 - 1) * 2;
cout << out[0] << " " << out[1] << " " << out[2] << " ";
printf("%.2lf\n", res);

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: