#include <iostream>
using namespace std;
int main()
{int n;double* p;//[100];cout << "请输入数据的个数n";cin >> n;p = new double[n];//cin >> n;cout << "请依次输入这些数据";double suma = 0;for (int i = 0; i < n; i++){cin >> p[i];suma += p[i];}double ave = suma / n;double* fc;// [100] ;//每一个数据与平均值的差的平方fc = new double[n];double sufc = 0;//fc的和for (int i = 0; i < n; i++){fc[i] = (p[i] - ave) * (p[i] - ave);sufc += fc[i];}double fcc = sufc / n;cout << "平均值为:" << ave;cout << "\n方差*个数为:" << sufc;cout << "\n方差为:" << fcc;//delete p;//delete fc;}