Стасу

 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
const
a=2;
b=7;
var
i, n: byte;
S, S1, S2, h,
x, f: real;
procedure integr;
begin
h:=(b-a)/n; S:=0;
for i:=1 to n do
begin
x:=a+h*i-h/2;
f:=exp(3*ln(x))*sqrt(1+x);
S:=S+f;
end; S:=S+h;
end;
BEGIN
n:=4; integr;
S1:=S; n:=n*2;
integr; S2:=S;
while (abs(s1-s2)>=0.0001) do
begin
n:=n*2;
integr; S1:=S2;
S2:=S;
end;
writeln(S:1:4);
END.