Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, ExtCtrls;
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Image1: TImage;
- Button2: TButton;
- Button3: TButton;
- Label1: TLabel;
- Label2: TLabel;
- Button4: TButton;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- a:Array[1..10] of Integer;
- implementation
- {$R *.dfm}
- procedure TForm1.Button1Click(Sender: TObject);
- var i:Integer;
- begin
- Image1.Canvas.Rectangle(0,0,Image1.Width,Image1.Height);
- Randomize;
- for i:=1 to 10 do
- begin
- a[i]:=random(50);
- Image1.Canvas.Textout(20+i*20,20,inttostr(a[i]));
- end;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- var o:Integer;
- begin
- for o:=1 to 10 do
- begin
- if a[o] mod 2=0 then
- Image1.Canvas.Font.Color:=clred
- else
- Image1.Canvas.Font.Color:=clblue;
- Image1.Canvas.TextOut(20+o*20,20,inttostr(a[o]));
- end;
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- var q:integer;
- var min:integer;
- var max:integer;
- var ox:integer;
- begin
- min:=50;
- max:=0;
- for q:=1 to 10 do begin
- if a[q]>max then max:=a[q];
- if a[q]<min then min:=a[q];
- Label1.Caption:=(' Biggast is '+inttostr(max)+' lowast is '+inttostr(min));
- ox:=ox+a[q];
- Label2.Caption:=(inttostr(ox));
- end;
- end;
- procedure TForm1.Button4Click(Sender: TObject);
- var c:integer;
- begin
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment