URI Online Judge Solution | 1006 Average 2

Problem:
https://www.urionlinejudge.com.br/judge/en/problems/view/1006

Solution:

It also use weighted average/mean
You can check this link for weighted mean   http://www.mathsisfun.com/data/weighted-mean.html

Weighted Mean =   Σwx
Σw
#include<stdio.h>
int main()
{
double a,b,c,result;
scanf("%lf %lf %lf",&a,&b,&c);
result=((a*2)+(b*3)+(c*5))/(2+3+5);
printf("MEDIA = %.1lf\n",result);
return 0;
}

 

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *