unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    Edit3: TEdit;
    edit4: TEdit;
    memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  //  procedure Edit3Change(Sender: TObject);
  private
{ Private declarations }
  public
{ Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
  mystr: Integer;
  i, j, a, b, f, o, q: Integer;
  out2, c, d, e, g, p, r: string;begin
  memo1.Text := '';
  a := strtoint(edit1.Text);
  j := strtoint(edit2.Text);
  o := strtoint(edit3.Text);
  q := strtoint(edit4.Text);
  b := 1;
  for i := 1 to j do
  begin    c := inttostr(i);
    d := inttostr(b);
    p := inttostr(o);
    r := inttostr(q);
    f := 1;    for f := a to j do
    begin
      if f <= b and  f <= q then      begin
        mystr := f * b;
        out2 := inttostr(mystr);
        g := inttostr(f);
        e := e + g + '*' + d + '=' + out2 + ' ' + '';
      end
    end;
    b := b + 1;
    memo1.lines.add(e);
    e := '';  end;
end;
end.
如何把这个算法封装成可调用的函数?题小分少,多谢赐教!