190
2-misol
. A(N,N) kvadrat matritsaning
ustun va satr elementlari
yig’indisini topish dasturi.
procedure Form1.Button2Click
(Sender: TObject);
var i,k:integer; S:real;
x:array [1..10,1..10] of integer;
s1:string;
begin
for i:=1 to strtoint(edit1.Text) do
for k:=1 to strtoint(edit1.Text) do
x[i,k]:= strtoint(StringGrid1.Cells[i,k]);
for i:=1 to strtoint(edit1.Text) do
begin s:=0; for k:=1 to
strtoint(edit1.Text) do
s:=s+x[i,k]; Str(s:7:2,s1);
Memo1.Lines.add(inttostr(i)+'-
ustun'+' '+'Yig‘indi ='+s1); end;
for k:=1 to strtoint(edit1.Text)
do begin s:=0;
for i:=1 to strtoint(edit1.Text) do s:=s+x[i,k]; Str(s:7:2,s1);
Memo2.Lines.add(inttostr(k)+'-satr'+' '+'Yig‘indi ='+s1);
end; end; end.
Dostları ilə paylaş: