#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n;
scanf("%d",&n);
int arr[1000];
long double addNum=0;
long double centerNum=0;
long double dNum = 0;
for(int i = 0;i < n;i++){
scanf("%d",arr+i);
addNum = addNum + arr[i];
}
centerNum = addNum/n;//平均值
for(int i = 0;i < n;i++){
dNum = dNum + (arr[i] - centerNum)*(arr[i] - centerNum);
}
dNum = dNum/n;
dNum = sqrt(dNum);
for(int i = 0;i < n;i++){
printf("%.16Lf\n",(arr[i]-centerNum)/dNum);
}
return 0;
}
202206-1 归一化处理
最新推荐文章于 2024-09-04 14:45:59 发布