Friday, October 26, 2018

Uri 1079 solution in C | Weighted Averages

/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/

#include<stdio.h>
main()
{
    int n,i;
    double k,m,b,s;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
            scanf("%lf%lf%lf",&k,&m,&b);
            s=((k*2)+(m*3)+(b*5))/10;
            printf("%.1lf\n",s);


    }
    return 0;
}

 //Happy_Coding

No comments:

Post a Comment