URI ONLINE JUDGE SOLUTION 1006 - Average 2

Problem:

Read three values (variables A, B and C), which are the three student's grades. Then, calculate the average, considering that grade A has weight 2, grade B has weight 3 and the grade C has weight 5. Consider that each grade can go from 0 to 10.0, always with one decimal place.

Input

The input file contains 3 values of floating points with one digit after the decimal point.

Output


Print MEDIA(average in Portuguese) according to the following example, with a blank space before and after the equal signal.

sample input output

Solution:

#include<stdio.h>
int main()
{
    double A,B,C,MEDIA;
    scanf("%lf",&A);
    scanf("%lf",&B);
    scanf("%lf",&C);
    MEDIA=((A*2)+(B*3)+(C*5))/10;
    printf("MEDIA = %0.1lf\n",MEDIA);
    return 0;

}

Comments

Popular posts from this blog

URI ONLINE JUDGE SOLUTION 1021 - Banknotes and Coins

URI ONLINE JUDGE SOLUTION 1040 - Average 3

URI ONLINE JUDGE SOLUTION 1036 - Bhaskara's Formula