1001 求平均年龄

来源:互联网 发布:发现网络存在问题 编辑:程序博客网 时间:2024/06/10 18:09

求平均年龄

Time Limit:1000MS  Memory Limit:65536K
Total Submit:536 Accepted:311

Description

班上有学生若干名,给出每名学生的年龄(整数),求班上所有学生的平均年龄,保留到小数点后两位。

Input

第一行有一个整数n(1≤n≤100),表示学生的人数。其后n行每行有1个整数,取值为15到25。

Output

输出一行,该行包含一个浮点数,为要求的平均年龄,保留到小数点后两位。

Sample Input

21817

Sample Output

17.50

Sample Result:

Source

POJ:2714


C

main(){    int n,a=0,b,c;    scanf("%d",&n);    c=n;    while(n){        scanf("%d",&b);        a+=b;        n--;    }    printf("%.2f",(float)a/c);}

0 0