unit U2matrik;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Button1: TButton;
ListBox1: TListBox;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Button2: TButton;
ListBox2: TListBox;
Button3: TButton;
ListBox3: TListBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
GroupBox3: TGroupBox;
procedure GroupBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure GroupBox2Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure GroupBox3Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
N:array [1..3, 1..4] of integer ;
M : array [1..3, 1..4] of integer ;
Q : array [1..3, 1..4] of integer ;
bdata : string ;
implementation
{$R *.dfm}
procedure TForm1.GroupBox1Click(Sender: TObject);
var i,j : integer ;
begin
for i:=1 to 3 do
for j:=1 to 4 do
N[I,J]:=0;
listbox1.Clear;
for I:=1 to 3 do
begin bdata:='';
for J:=1 to 4 do
begin
bdata:=bdata+' '+inttostr (N[I,J]);
end;
listbox1.AddItem(bdata, listbox1);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var i,j : integer ;
k,l : integer ;
bdata :string ;
begin
k:=strtoint (edit1.Text);
l:=strtoint (edit2.Text);
N[K,L]:= strtoint (edit3.Text);
listbox1.Clear;
listbox1.Clear;
for I:=1 to 3 do
begin bdata:='';
for J:=1 to 4 do
begin
bdata:=bdata+' '+inttostr (N[I,J]);
end;
listbox1.AddItem(bdata, listbox1);
end;
end;
procedure TForm1.GroupBox2Click(Sender: TObject);
var i,j : integer ;
sdata : string ;
begin
for i:=1 to 3 do
for j:=1 to 4 do
M[I,J]:=0;
listbox2.Clear;
for I:=1 to 3 do
begin sdata:='';
for J:=1 to 4 do
begin
sdata:=sdata+' '+inttostr (M[I,J]);
end;
listbox2.AddItem(sdata, listbox2);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i,j : integer ;
o,p : integer ;
sdata :string ;
begin
o:=strtoint (edit4.Text);
p:=strtoint (edit5.Text);
M[O,P]:= strtoint (edit6.Text);
listbox2.Clear;
listbox2.Clear;
for I:=1 to 3 do
begin sdata:='';
for J:=1 to 4 do
begin
sdata:=sdata+' '+inttostr (M[I,J]);
end;
listbox2.AddItem(sdata, listbox2);
end;
end;
procedure TForm1.GroupBox3Click(Sender: TObject);
var i,j : integer ;
begin
for i:=1 to 3 do
for j:=1 to 4 do
Q[I,J]:=0;
listbox3.Clear;
for I:=1 to 3 do
begin bdata:='';
for J:=1 to 4 do
begin
bdata:=bdata+' '+ inttostr(Q[I,J]);
end;
listbox3.AddItem(bdata, listbox3);
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var i,j : integer ;
begin
for i:=1 to 3 do
for j:=1 to 4 do
Q[I,J]:=0;
listbox3.Clear;
for I:=1 to 3 do
begin bdata:='';
for J:=1 to 4 do
begin
bdata:=bdata+' '+ inttostr(N[I,J]+ M[I,J]);
end;
listbox3.AddItem(bdata, listbox3);
end;
end;
end.
No comments:
Post a Comment