try s := -0.22 * Ln(k) + 0.23; except S := 0; // 或者MessageBox // 或者Raise; end;
Try s:=-0.22*Ln(k)+0.23 Except s:=??? End;
但是还是有 这个错误 'Floating point division by zero'. for i:=1 to 10 do for j;=1 to 9 do for k:=1 to 5 do begin try s[i][j][k]:=-0.22*Ln(k[i][j][k])+0.23; Except
s := -0.22 * Ln(k) + 0.23;
except
S := 0;
// 或者MessageBox
// 或者Raise;
end;
s:=-0.22*Ln(k)+0.23
Except
s:=???
End;
for i:=1 to 10 do
for j;=1 to 9 do
for k:=1 to 5 do
begin
try
s[i][j][k]:=-0.22*Ln(k[i][j][k])+0.23;
Except
s[i][j][k]:=0;
end;
其实你可以先判断k[i][j][k]的值啊,值不等于0才执行运算。
还有,数组k和序数k同名,我不知道会不会有什么问题,但不管怎样,为了不至混淆,应该尽量避免