procedure TForm1.ButtonCalcClick(Sender: TObject);
var a, b, s:real;
n, i:integer;
begin
if (Trim(EditA.Text) = '') or (Trim(EditB.Text) = '') or
(Trim(EditS.Text) = '') then
begin
ShowMessage('Не введены исходные данные');
exit;
end;
a:= StrToFloat(EditA.Text);
b:= StrToFloat(EditB.Text);
s:= StrToFloat(EditS.Text);
if (a = b) or ((s<0) or (s>1)) then
begin
ShowMessage('Неверные данные');
exit;
end;
if a > b then
begin
s:= a;
a:= b;
b:= s;
end;
for i:= 1 to n do
begin
StringGridFunc.Cells[0, i]:= FloatToStr(a);
StringGridFunc.Cells[1, i]:= FloatToStr((sqrt(2*a-5)-sqrt(4*a+9))/(3*(a+2)));
StringGridFunc.Cells[2, i]:= FloatToStr((a*sin(a+1)-3*sin(a))/Power((2*a-6),3));
a:= a + s;
end;
end;
procedure TForm1.EditAKeyPress(Sender: TObject; var Key: Char);
begin
if (Key in['0'..'9', Chr(44), Chr(VK_BACK)]) = false then Key:=#0;
end;
procedure TForm1.EditBKeyPress(Sender: TObject; var Key: Char);
begin
if (Key in['0'..'9', Chr(44), Chr(VK_BACK)]) = false then Key:=#0;
end;
procedure TForm1.EditSKeyPress(Sender: TObject; var Key: Char);
begin
if (Key in['0'..'9', Chr(44), Chr(VK_BACK)]) = false then Key:=#0;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
StringGridFunc.Cells[0,0]:='x';
StringGridFunc.Cells[1,0]:='(sqrt(2*x-5)-sqrt(4*x+9))/(3*(x+2))';
StringGridFunc.Cells[2,0]:='(x*sin(x+1)-3*sin(x))/power((2*x-6),3))';
end;
end.
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.