3.Dasturi.
3.3-listingda dasturning matni keltirilgan.
3.3-Listing
unit lookmin_;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Grids;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
const
SIZE=5;
var
a:array[1..SIZE]of integer; // Butun sonli massiv
min:integer; // Massivning eng kichik elementini tartib raqami
i:integer; // eng kichik element bilan
//solishtirilayotgan elementning tartib raqami
begin
// Massivni kiritish
for i:=1 to SIZE do
a[i]:=StrToInt(StringGrid1.Cells[i-1,0]);
// eng kichik elementini izlash
min:=1; // birinchi elementni eng kichik deb olaylik
for i:=2 to SIZE do
if a[i]< a[min] then min:=i;
// Natijani chiqarish
label2.caption:='Massivning eng kichik elementi:'+IntToStr(a[min])
+#13+'Element tartib raqami:'+ IntToStr(min);
end;
end.
4.Natija.
3.3-rasmda massivning eng kichik elementini izlash ilovasining muloqot oynasi keltirilgan.
3.3-rasm
5.Topshiriqlar.
55%-71% orasidagi o`zlashtiruvchilar uchun topshiriqlar.
3.5-jadval
Dostları ilə paylaş: |