Begin d[i,j]:=0; for k:=1 to n do d[i,j]:=d[i,j]+ma[i,k]*b[k,j]; end; writeln;...

0 голосов
67 просмотров

Begin
d[i,j]:=0;
for k:=1 to n do
d[i,j]:=d[i,j]+ma[i,k]*b[k,j];
end;



writeln;
writeln('Final matrix:');
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
d[i,j]:=b[i,j]*ma[i,j];
write(d[i,j]:4);
end;
end;
end.
Что тут неправильно? подскажите пожалуйста


Информатика (32 баллов) | 67 просмотров
Дан 1 ответ
0 голосов
Правильный ответ

Writeln;
writeln('Final matrix:');
for i:=1 to n do
begin
for j:=1 to n do
begin
d[i,j]:=0;
for k:=1 to n do
d[i,j]:=d[i,j]+ma[i,k]*b[k,j];
 write(d[i,j]:4);
end;
writeln;
end;
end.

(194k баллов)
0

const n=2;
var
a,b,c,d,ma: array [1..n,1..n] of integer;
i,j,k: integer;

begin
randomize;

writeln (' Matrix A;');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
a[i,j]:=random(10);
write (a[i,j]:4);
end;
end;
writeln;

writeln ('Matrix C;');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
c[i,j]:=random(10);
write (c[i,j]:4);
end;
end;
writeln;

writeln ('Matrix B');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
b[i,j]:=a[i,j]+c[i,j];
write (b[i,j]:4);
end;
end;
writeln;

0

writeln('Transpose matrix C');
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
ma[i,j]:=c[j,i]; 
write(ma[i,j]:4);
end;
end;

begin
d[i,j]:=0;
for k:=1 to n do
d[i,j]:=d[i,j]+ma[i,k]*b[k,j]; 
end;

writeln;
writeln('Final matrix:');
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
d[i,j]:=b[i,j]*ma[i,j];
write(d[i,j]:4);
end;
end;
end.

writeln('Transpose matrix C');
for i:=1 to n do
begin
writeln;
for j