

Модераторы: Duncon, Naeel Maqsudov, Игорь Акопян, Хыиуду
Код: Выделить всё
procedure TForm1.Button2Click(Sender: TObject);
var
Mas:Array[1..5,1..5] of Integer;
Max,x,y:Integer;
begin
Randomize;
For x:=1 to 5 do
For y:=1 to 5 do
mas[x,y]:=Random(50);
Label2.Caption:='';
For x:=1 to 5 do
For y:=1 to 5 do
Label2.Caption:=Label2.Caption+IntToStr(mas[x,y])+' ';
Max:=Mas[1,1];
For x:=1 to 5 do
For y:=1 to 5 do
If Mas[x,y]>Max then
Max:=Mas[x,y];
Edit2.Text:=IntToStr(Max);
end;
Код: Выделить всё
procedure TForm1.Button1Click(Sender: TObject);
var
max,min,s,i:Integer;
Edit: Array[1..5] of Integer;
begin
Randomize;
For i:=1 to 5 do
Edit[i]:=Random(10);
Label1.Caption:='';
For i:=1 to 5 do
Label1.Caption:=Label1.Caption+' '+IntToStr(Edit[i]);
Max:=Edit[1];
For i:=1 to 5 do
If Edit[i]>Max then
Max:=Edit[i];
Min:=Edit[1];
For i:=1 to 5 do
If Edit[i]<Min then
Min:=Edit[i];
Edit1.Text:=IntToStr(Max)+' '+IntToStr(Min);
end;
Код: Выделить всё
Max:=Edit[1];
Min:=Edit[1];
For i:=1 to 5 do
Begin
If Edit[i]>Max then
Max:=Edit[i];
If Edit[i]<Min then
Min:=Edit[i];
end;