当前位置:首页>开发>正文

Delphi求帮编程 delphi编程

2023-04-24 16:31:50 互联网 未知 开发

 Delphi求帮编程 delphi编程

Delphi求帮编程

Type
    TFruit=Class
    private
    FName:string
    FColor: Tcolor
    FTaste: Ttaste
    public
    property  Color: string read  FColor write SetColor default ‘white’
    procedure    Infor
    end

delphi编程

unit Unit1 interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls type TForm1 = class(TForm) maxnum: TButton minnum: TButton avenum: TButton Label1: TLabel procedure maxnumClick(Sender: TObject) procedure FormActivate(Sender: TObject) procedure minnumClick(Sender: TObject) procedure avenumClick(Sender: TObject) private { Private declarations } public { Public declarations } end var Form1: TForm1 a:array[1..10] of integer implementation {$R *.dfm} procedure TForm1.maxnumClick(Sender: TObject) var i,max:integer begin max:=a[1] for i:=2 to 10 do if a[i]>max then max:=a[i] label1.Caption :=inttostr(max) end procedure TForm1.FormActivate(Sender: TObject) var i:integer begin for i:=1 to 10 do begin randomize a[i]:=random(100) label1.Caption :=label1.Caption inttostr(a[i]) end end procedure TForm1.minnumClick(Sender: TObject) var i,min:integer begin min:=a[1] for i:=2 to 10 do if a[i]

最新文章