Ўзбекистон алоқа ва ахборотлаштириш агентлиги тошкент ахборот технологиялари университети самарқанд филиали
Download 273.5 Kb.
|
4-лаборатория
- Bu sahifa navigatsiya:
- Operatsiyalar soni
Tozalash tugmasi:
procedure TForm1.Button3Click(Sender: TObject); var i,j:integer; begin Label3.Caption:=''; Label4.Caption:=''; Label7.Caption:=''; for i:=1 to StringGrid1.ColCount-1 do for j:=1 to StringGrid1.RowCount-1 do StringGrid1.Cells[i,j]:=''; end; Operatsiyalar soni: procedure TForm1.SpinEdit1Change(Sender: TObject); var i:integer; begin StringGrid1.ColCount:=SpinEdit1.Value+1; for i:=1 to SpinEdit1.Value do StringGrid1.Cells[i,0]:='P'+IntToStr(i); end; unit Unit1; interface uses
Dialogs, Grids, ExtCtrls, Menus, StdCtrls, Spin, XPMan; type
Panel1: TPanel; Panel2: TPanel; StringGrid1: TStringGrid; MainMenu1: TMainMenu; Fayl1: TMenuItem; Chiqish1: TMenuItem; Muallif1: TMenuItem; Dasturhaqida1: TMenuItem; SpinEdit1: TSpinEdit; Button1: TButton; GroupBox1: TGroupBox; Label3: TLabel; Label1: TLabel; Label2: TLabel; Label4: TLabel; Button2: TButton; Label5: TLabel; GroupBox2: TGroupBox; Label7: TLabel; Button3: TButton; XPManifest1: TXPManifest; procedure Chiqish1Click(Sender: TObject); procedure SpinEdit1Change(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Dasturhaqida1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var
implementation {$R *.dfm} procedure TForm1.Chiqish1Click(Sender: TObject); begin Close; end; procedure TForm1.SpinEdit1Change(Sender: TObject); var i:integer; begin StringGrid1.ColCount:=SpinEdit1.Value+1; for i:=1 to SpinEdit1.Value do StringGrid1.Cells[i,0]:='P'+IntToStr(i); end; procedure TForm1.FormCreate(Sender: TObject); var i:integer; begin StringGrid1.Cells[0,1]:='M1'; StringGrid1.Cells[0,2]:='M2'; for i:=1 to SpinEdit1.Value do StringGrid1.Cells[i,0]:='P'+IntToStr(i); end; procedure TForm1.Button1Click(Sender: TObject); var b:boolean; s1,s2,s3,s4,s5:string; i,i1,j,k,m,n,min:integer; a:array[1..2,1..100] of integer; st:set of byte; f,l:integer; ss,sb:array[1..100] of string; begin Label3.Caption:=''; Label4.Caption:=''; Label7.Caption:=''; f:=1; l:=1; st:=[0]; for i:=1 to 2 do for j:=1 to StringGrid1.ColCount-1 do a[i,j]:=StrToInt(StringGrid1.Cells[j,i]); b:=true;
s1:=''; s2:=''; s3:=''; for i:=1 to m do begin k:=1; while ((k in st)) do begin inc(k); if k=m then break; end; n:=k; if b then min:=a[1,k] else min:=a[2,k]; for j:=1 to m do begin if b then if (a[1,j] min:=a[1,j]; n:=j; end; if not b then if (a[2,j] min:=a[2,j]; n:=j; end; end;
if b then
else
ss[f]:=inttostr(min); inc(f); s2:=s2+inttostr(min)+', '; s5:=s5+' ,'+inttostr(n)+'P'; end; st:=st+[n]; b:=not b; end;
Label3.Caption:=s1;
end;
procedure TForm1.Button2Click(Sender: TObject);
end;
procedure TForm1.Button3Click(Sender: TObject);
procedure TForm1.Dasturhaqida1Click(Sender: TObject); begin ShowMessage('Dastur muallifi: 4 - kurs talabasi Rabbimov Murod'); end; end.
Download 273.5 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling