BUPT-homework/pset9/1-avg.c
2021-11-25 16:13:12 +08:00

16 lines
250 B
C

#include <stdio.h>
int main(void) {
int n;
scanf("%i", &n);
double arr[n];
for (int i = 0; i < n; i++) {
scanf("%lf", &arr[i]);
}
double sum = 0;
for (int i = 0; i < n; i++) {
sum += arr[i];
}
printf("%.2lf\n", sum / n);
}