NOJ/35/main.c
Saturneric 52668c4122 Add.
2020-09-01 00:46:43 +08:00

20 lines
326 B
C

#include <stdio.h>
#define TH(x) ((x)*(x))
int main(void){
int number,i;
double avg,temp[33000];
scanf("%d",&number);
for(i = 0 ;i < number; i++){
scanf("%lf",&temp[i]);
avg += temp[i];
}
avg /= number;
double s = 0.0;
for(i = 0; i < number; i++){
s += TH(temp[i] - avg);
}
printf("%.6lf\n",s);
return 0;
}