题解 | #小乐乐计算函数#
知识点:
函数:函数
#include <iostream>
using namespace std;
int max3(int a, int b, int c);
int main() {
int a, b, c;
cin >> a >> b >> c;
double res;
res = (double)max3(a + b, b, c) / (max3(a, b + c, c) + max3(a, b, b + c));
printf("%.2f", res);
return 0;
}
int max3(int a, int b, int c) {
int max;
max = a > b ? a : b;
max = max > c ? max : c;
return max;
}
查看30道真题和解析
