目录
1,题目描述
Sample Input:
1.1 2.5 1.7
1.2 3.1 1.6
4.1 1.2 1.1
Sample Output:
T T W 39.31
题目大意:
题目花里胡哨的,然而主要思想很简答:只需要找出每一行数字最大值对应的字符,并记录此数字,三行过后,按公式计算即可(公式是什么意思,我也没看懂。。。但不妨碍做题)
2,思路
就是你想的那样。
3,代码【C++】
#include<iostream>
using namespace std;
int main(){
//#ifdef ONLINE_JUDGE
//#else
// freopen("1.txt", "r", stdin);
//#endif
float temp, max = 0.0f, ans = 1;
char c = 'W';
char res[3];
for(int i = 0 ; i < 3 ; i++){
for(int j = 0; j < 3; j++){
cin>>temp;
if(temp > max){
max = temp;
if(j == 1) c = 'T';
else if(j == 2) c = 'L';
}
}
res[i] = c;
ans *= max;
max = 0.0f;
c = 'W';
}
cout<<res[0]<<' '<<res[1]<<' '<<res[2]<<' ';
ans = (ans * 0.65 - 1 ) * 2;
printf("%.2f", ans);
return 0;
}