1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <iostream>
#include <cmath>
double deviation(double first, double second, double third, double fourth);
double average(double first, double second, double third, double fourth);
double average2(double first, double second, double third, double fourth);
using namespace std;
int main()
{
double first = 1.0, second = 2.0, third = 3.0, fourth = 4.0;
return 0;
}
double deviation(double first, double second, double third, double fourth)
{
return sqrt(average2(first, second, third, fourth));
}
double average(double first, double second, double third, double fourth)
{
return (first + second + third + fourth) / 4;
}
double average2(double first, double second, double third, double fourth)
{
return (first - average(first, second, third, fourth)) + (second - average(first, second, third, fourth)) + (third - average(first, second, third, fourth)) + (fourth - average(first, second, third, fourth));
}
|