random lab101

 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
Program errorLab101;
var x1, x2, x3, x4, x5, x_avg, S_x, S_x_avg: real;
random_error_x: real;
error_instrum_x: real;
round_error_x: real;
sum_error_x: real;
ro_avg_abc, ro_avg_dh, abs_ro_abc, abs_ro_dh: real;
function h(s: real): real;
var i: integer;
begin
i := 0;
h := 1;
while i < 10 do begin
if frac(s) > 0 then begin
s := s * 10;
i := i + 1;
h *= 0.1;
end else break;
end;
end;
begin
writeln('Vvedt vse izmereniya: ');
read(x1, x2, x3, x4, x5);
x_avg := (x1 + x2 + x3 + x4 + x5) / 5;
S_x := sqrt((sqr(x1 - x_avg) + sqr(x2 - x_avg) + sqr(x3 - x_avg) + sqr(x4 - x_avg) + sqr(x5 - x_avg)) / 4);
write(S_x:5:3);
end.