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****

Sunday 30 October 2016

F. Average


Problem link
https://algo.codemarshal.org/contests/diu-122-fl16-termwork/problems/F

Score: 1

CPU: 1s
Memory: 512MB

You will be given five integer numbers. Calculate the average of given numbers.

Input

There will be five integer numbers a, b, c, d and e ( 1 < a, b, c, d, e < 1000 ) in one line separated by single spaces.

Output

Print the average with two digits after decimal point.

Sample

InputOutput
1 2 3 4 53.00

Solution

#include<stdio.h>
int main()
{
    int a,b,c,d,e;
    double avg;
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);

    if(1<a,b,c,d,e<1000){
       avg=(a+b+c+d+e);
    }
    printf("%.2lf\n",avg/5);
    return 0;
}

No comments:

Post a Comment