uses wincrt;
var
i, n, f: integer;
begin
readln (n);
f:=1;
i:=0;
repeat
i:= i + 1;
f:= f * i;
until i=n;
writeln (n,' faktorial= ', f);
end.
uses wincrt;
var A,B,c: array [1..10,1..10] of integer;
i, j, b1, k1, b2, k2, r, sum : integer;
begin
write ('masukkan jumlah baris matriks 1 : '); readln(b1);
write ('masukkan jumlah kolom matriks 1 : '); readln(k1);
write ('masukkan jumlah baris matriks 2 : '); readln(b2);
write ('masukkan jumlah kolom matriks 2 : '); readln(k2);
for i:= 1 to b1 do
for j:= 1 to k1 do
readln (A[i,j]);
for i:=1 to b2 do
for j:=1 to k2 do
readln (B[i,j]);
writeln;
writeln ('matriks 1');
writeln ('=========');
for i:=1 to b1 do
begin
for j:=1 to k1 do
write (A[i,j],' ');
writeln;
end;
writeln ('matriks 2');
writeln ('=========');
for i:= 1 to b2 do
begin
for j:= 1 to k2 do
write (B[i,j],' ');
writeln;
end;
writeln ('matriks 1 + 2');
c[i,j]:= 0;
for i:= 1 to b1 do
begin
for j:= 1 to b2 do
begin
c[i,j]:= c[i,j]+A[i,j]+B[i,j];
write (c[i,j],' ');
end;
writeln;
end;
end.
0 komentar:
Posting Komentar