Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Thursday, 10 November 2016

URI-1006

URI Online Judge | 1006

Average 2

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem link Click here
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.
Input SamplesOutput Samples
5.0
6.0
7.0
MEDIA = 6.3
5.0
10.0
10.0
MEDIA = 9.0
10.0
10.0
5.0
MEDIA = 7.5



Solution...

#include<stdio.h>

int main(){
    float a,b,c;

    scanf("%f %f%f",&a,&b,&c);

    printf("MEDIA = %.1f\n",(a*2+b*3+c*5)/10));

    return 0;
}

No comments:

Post a Comment