607.Average 2
Read the values of three floating-point numbers A, B, and C, corresponding to the results of the three students.
Please calculate the student’s average score, where the weight of A’s score is 2, the weight of B’s score is 3, and the weight of C’s score is 5.
The value range of the score is between 0 and 10, and all of them are kept to one decimal place.
Input format
There are three lines of input, each line contains a floating point number, the first line represents A, the second line represents B, and the third line represents C.
Output format
The output format is "MEDIA = X", where X is the average score, and the result is to one decimal place.
data range
0≤A,B,C≤10.0
Input sample:
5.0
6.0
7.0
Sample output:
MEDIA = 6.3
#include <cstdio>
int main()
{
double a, b, c;
scanf("%lf%lf%lf", &a, &b, &c);
printf("MEDIA = %.1lf\n", (a * 2 + b * 3 + c * 5)/10);
return 0;
}