Procedure TForm1.Button1Click(Sender: TObject); var s: string; i: integer; k: real; begin Edit1.Text := Edit1.Text + ' '; for i := 1 to length(Edit1.Text) do begin if (Edit1.Text[i] = ' ') then begin if (sqr(k) < StrToFloat(s)) then begin k := sqrt(StrToFloat(s)); s := ''; end; end else s := s + Edit1.Text[i]; end; Edit1.Text := FloatToStr(sqrt(sqr(k) + sqr(k))); end;
var
s: string;
i: integer;
k: real;
begin
Edit1.Text := Edit1.Text + ' ';
for i := 1 to length(Edit1.Text) do
begin
if (Edit1.Text[i] = ' ') then
begin
if (sqr(k) < StrToFloat(s)) then
begin
k := sqrt(StrToFloat(s));
s := '';
end;
end
else
s := s + Edit1.Text[i];
end;
Edit1.Text := FloatToStr(sqrt(sqr(k) + sqr(k)));
end;
Площади в Edit1 через пробел:)