Advertisement
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, ExtCtrls, StdCtrls;
- type
- TForm1 = class(TForm)
- Image1: TImage;
- Button1: TButton;
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- c:TCanvas;
- d,f, nr,l,nt,k,y,i:integer;
- r:array [1..5] of string ;
- t:array[1..5] of integer;
- h:array [1..5] of integer;
- implementation
- {$R *.dfm}
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- c:=Image1.Canvas;
- c.Brush.Color:=clwhite;
- c.Pen.Color:=clblack;
- c.Rectangle(0,0,Image1.Width,Image1.Height);
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- randomize;
- k:=100;
- for i:=1 to 5 do begin
- r[i]:=InputBox('rieky','mena','Napis');
- h[i]:=random(50);
- t[i]:=random(30);
- if t[i] < k then begin
- k:=t[i];
- f:=i;
- end;
- if h[i]> l then begin
- l:=h[i];
- d:=i;
- end;
- y:=y+15;
- c.TextOut(20,y,r[i]+ ' '+inttostr(t[i])+ '° '+inttostr(h[i])+'m');
- end;
- y:=y+15;
- c.TextOut(20,y,'najchladnesia rieka je '+' '+r[f]+' '+inttostr(k)+' ° ' + 'a najhlbsia je '+ r[d]+' '+ inttostr(l)+'m ');
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement