Kamis, 05 Januari 2012

prOgrAm TranPosE MatikS

program tranposmatriks;
uses wincrt;
var
A,B,C,D : array [1..10,1..10] of integer;
i,j,k,l : integer;
n,p,g : integer;
begin
writeln('matriks 1');
read(n);read(p);writeln;
for i:=1 to n do begin
for j:=1 to p do begin
readln(A[i,j]);
end;
end;
for i:=1 to n do begin
for j:=1 to p do begin
write(A[i,j]:5);
end;writeln;
end;
writeln;      writeln('matriks transpose');
for k:=1 to p do begin
for l:=1 to n do begin
write(A[l,k]:5); B[k,l]:=A[l,k];
end;writeln;
end; 
writeln;
for i:=1 to n do begin
for j:=1 to n do begin    C[i,j]:=0;
for k:=1 to p do begin  
C[i,j]:=C[i,j]+A[i,k]*B[k,j];
end;end;end;
for i:=1 to n do begin
for j:=1 to n do begin
write(C[i,j]:5);
end;writeln;
end;
end.

Tidak ada komentar:

Posting Komentar