|
-listing. Massivning eng kichik elementini topish
|
bet | 52/209 | Sana | 16.01.2022 | Hajmi | 9,81 Mb. | | #371485 |
| Bog'liq DELPHI dasturlash titli 2018
7.6-listing. Massivning eng kichik elementini topish
procedure TForm1.ButtonlClick(Sender: TObject);
const
SIZE 5;
var
a : array[1..SIZE]of integer; butun sonlar massivi
min : integer; massivning eng kichik elementi nomeri
i : integer; eng kichigi bilan solishtirilayotgan element nomeri
begin
for I : 1 to SIZE do
a[i] : StrToInt(StringGrid1.Cells[i-1,0]);
min : 1; birinchi element eng kichik bo`lsin
for i : 2 to SIZE do
if a[i]< a[min]then min : i;
label2.caption : 'Massivning eng kichik elementi:'
IntToStr(a[min]) #13 'Bu elementning nomeri :' IntToStr(min);
end;
end.
7.8-rasm. Eng kichik elementni topish dasturining dialog oynasi
Do'stlaringiz bilan baham: |
|
|