您的位置:首页 > 其它

99乘法表

2009-10-25 13:32 267 查看
unit Unit1;

interface

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

type
TForm1 = class(TForm)
StringGrid1: TStringGrid; //ColCount RowCount 这两个属性都改成10
Button1: TButton;
procedure Button1Click(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(j*i);
end;
end;

end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: