function stepen real st integer real var integer real begin for to st-

 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
44
45
46
47
48
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
function stepen(a:real; st:integer):real;
var
i:integer;
m:real;
begin
m:=a;
for i:=1 to st-1 do a:=a*m;
result:=a;
end;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//Подсчёт iQx
procedure iQx;
var
r:real;
i,st1,st2:integer;
v,iqx,ipx:real;
writev,writeqx,writepx:string;
begin
r:=strtofloat(Form1.stringgrid2.Cells[1,4]); v:=1/(1+r);
str(v:8:4,writev);
Form1.label13.Caption:=writev;
for i:=1 to XX do
begin
tablife[i]:=strtoint(Form1.stringgrid1.Cells[1,i]);
//if tablife[i]>tablife[i-1] then
end;
for i:=1 to XX do
begin
st1:=tablife[i];
st2:=tablife[i+1];
iqx:=(st1-st2)/tablife[round(((110-(XX-1)*5))/5)+1];
masqx[i]:=iqx;
str(iqx:8:4,writeqx);
Form1.stringgrid3.Cells[i,1]:=writeqx;
ipx:=1-iqx;
str(ipx:8:4,writepx);
Form1.stringgrid3.Cells[i,2]:=writepx;
end;
for i:=2 to XX do masqx[i]:=masqx[i-1]+masqx[i];
//masqx[XX]:=1;
for i:=1 to XX do masqx[i]:=masqx[i]*1000;
end;