unit1.~pas

来自「此软件是用delphi编写的一个可以显示打印九九乘法表小程序」· ~PAS 代码 · 共 71 行

~PAS
71
字号
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Grids;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
Var
 i,j:integer;
begin
stringgrid1.Cells[0,0]:='99乘法表';
for j:=1 to 9 do
for i:=1 to 9 do
    begin
stringgrid1.Cells[i,0]:=IntToStr(i);
stringgrid1.Cells[0,j]:=IntToStr(j);
stringgrid1.Cells[i,j]:=IntToStr(j)+
                    '*'+IntToStr(i)+
                    '='+IntToStr(i*j);
     end;
end;

procedure TForm1.Button3Click(Sender: TObject);
Var
 i,j:integer;
begin
i:=1;j:=0;
while i <= 100 do begin
j:=j+I;
inc(i,1);
end;
Caption:=IntTostr(j);
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  i,j,k:integer;
begin
i:=11;j:=33;
repeat
  K := I mod J;
  I := J;
  J := K;
until J = 0;
Caption:=IntToStr(i);
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?