Kod: Tümünü seç
unit matrishesap;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo2: TMemo;
Memo3: TMemo;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
a,b,c:array[1..3,1..3]of integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.ReadOnly:=true;
memo2.ReadOnly:=true;
memo3.ReadOnly:=true;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
begin
memo1.Text:='';
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
a[i,j]:=strtoint(inputbox('A matrisi',inttostr(i)+','+inttostr(j)+'.elemanın degeri:','1'));
memo1.Text:=memo1.Text+' '+inttostr(a[i,j]);
end;
memo1.Text:=memo1.Text+#13#10
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
i,j:integer;
begin
memo2.Text:= ' ' ;
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
b[i,j]:=strtoint(inputbox('B matrisi',inttostr(i)+','+inttostr(j)+'.elemanın değeri:','1'));
memo2.Text:=Memo2.Text+' '+inttostr(b[i,j]);
end;
memo2.Text:=memo2.Text+#13#10
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
i,j:integer;
begin
memo3.Text:=' ';
for i:=1 to 3 do
begin
for j:=1 to 3 do
c[i,j]:=A[i,j]+B[i,j];
memo3.Text:=memo3.Text+' '+inttostr(c[i,j]);
end;
memo3.Text:=memo3.Text+#13#10
end;
end.