ввод вероятности

 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
#include<iostream.h>
int main()
{
double ver[5];////*****************************
double rez=0; //// vvod veroyatnosti + proverka
double a=0; ////*****************************
double M=0;
for(int x=0; x<5; x++)
cin>>ver[x];
cout<<" X | 5 | 10| 15| 20| 25|"<<endl;
cout<<"-------------------------"<<endl;
for(int e=0; e<5; e++){
rez=a+ver[e];}
if(rez=1){
cout<<"P(x)|";
for(int y=0; y<5; y++){
cout<<ver[y]<<"|";
}
}
else if (rez>=1.1)
{
cout<<"ERROR"<<endl;
};//////////////////////////vvod veroyatnosti + proverka
cout<<""<<endl;
M=5*ver[0]+10*ver[1]+15*ver[2]+20*ver[3]+25*ver[4];
cout<<" "<<endl;
cout<<"ego mat ojidanie = "<<M<<endl;
return 0;
}