include iostream include math int main double ver double rez vvod vero

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<iostream.h>
#include<math.h>
int main()
{
double ver[6];////*****************************
double rez=0; //// vvod veroyatnosti + proverka
double a=0; ////*****************************
double n=6;
double M;
double s;
int x[6];
x[0]=7;
x[1]=9;
x[2]=12;
x[3]=14;
x[4]=17;
x[5]=20;
double z=0;
double u=0;
double S=0;
double D=0;
s=x[0]+x[1]+x[2]+x[3]+x[4]+x[5];
M=(1/n)*s;
cout<<"M = "<<M<<endl;
for(int i=0; i<6; i++){
u=x-M;
u=u*u;
z=z+u;
}
S=sqrt((1/n)*z);
cout<<"S = "<<S<<endl;
D=S*S;
cout<<"D = "<<D<<endl;
return 0;
}