URI Online Judge | 1006 Average (Solution)
Problem Link:
https://www.urionlinejudge.com.br/judge/en/problems/view/1006
Solution:
https://www.urionlinejudge.com.br/judge/en/problems/view/1006
URI Online Judge | 1006
Average 2
Adapted by Neilor Tonin, URI
Brazil
Timelimit: 1
Brazil
Read three numbers (variables A, B and C), which are the test scores of a student. Then, calculate the average, knowing that the note A has a weight of 2, the note B has a weight of 3 and the note C has a weight of 5. Consider that each note can go from 0 to 10.0, always with one decimal place.
Input
The input file contains 3 floating-point numbers 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 | Sample Output |
| 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 |
#include<stdio.h>int main(){ double a,b,c; scanf("%lf %lf %lf",&a,&b,&c); printf("MEDIA = %.1lf\n",(((a*2)+(b*3)+(c*5))/(2+3+5))); return 0;}
Comments
Post a Comment