题解 | #求平均年龄#
求平均年龄
https://www.nowcoder.com/practice/ca319fdb02714994850cc631d76f5547
#include<stdio.h> int main(){ int n; while (scanf("%d", &n) != EOF){ float sum = 0; for (int i = 0; i < n; i++){ int p; scanf("%d", &p); sum = sum + p; } printf("%.2f\n", sum/n); } }