#include <iostream>
#include<cstdlib>
#include<fstream>
#include<iomanip>
#include<cmath>
usingnamespace std;
// Program reads input from a file with numbers of type double
// displays their average and standard deviation on the screen.
int main()
{
ifstream fin;
fin.open("inputData.dat");
ofstream fout;
fout.open("outputData.dat");
double next, sum = 0 ;
int count = 0, avg = 0, stdDev = 0, variance;
while(fin >> next)
{
cout<<setw(6)<<next<<endl;
}
while (fin >> next )
{
fin>>next;
sum = sum + next;
count ++;
avg = sum / count ;
variance = pow((avg - next),2);
stdDev = sqrt(variance);
cout<<" The Average of the numbers is "<<avg<<endl;
cout<<" whilst their standard deviation is "<<stdDev<<endl;
}
fin.close();
fout.close();
return 0;
}