tempat BERJUANG
About Me
- arista WHIE
- hai.. welcome to my blog... namaku wiwik.. Asli BALI.. aku kuliah di ITS jurusan STATISTIKA.. NRP 1311100020.. silahkan menikmati blogku.. see it n' enjoy it... semoga bermanfaat... kalau ad kurang g usah sungkan kasi komentar ya..
Diberdayakan oleh Blogger.
Pengikut
Sabtu, 10 Desember 2011
program matrik jumlah, kurang, kali
program matrik;
uses wincrt;
var
a,b,c :array [1..10,1..10] of integer;
i,j,h, baris1, kolom1, baris2, kolom2:integer;
begin
readln(baris1);
readln(kolom1);
begin
for i:=1 to baris1 do
for j:=1 to kolom1 do
readln (a[i,j]);
writeln;
begin
readln (baris2);
readln (kolom2);
for i:=1 to baris2 do
for j:=1 to kolom2 do
readln (b[i,j]);
end;
begin
for i:=1 to baris1 do
begin
for j:=1 to kolom2 do
begin
c[i,j]:=0;
c[i,j]:=c[i,j]+a[i,j]+b[i,j];
write (c[i,j]:2,' ');
end;
writeln;
end;
begin
begin
for i:=1 to baris1 do
begin
for j:=1 to kolom2 do
begin
c[i,j]:=0;
c[i,j]:=c[i,j]+a[i,j]-b[i,j];
write (c[i,j]:2,' ');
end;
writeln;
end;
begin
for i:=1 to baris1 do
begin
for j:=1 to kolom2 do
begin
c[i,j]:=0;
for h:=1 to kolom1 do
c[i,j]:=c[i,j]+a[i,h]*b[h,j];
write (c[i,j]:2,' ');
end;
writeln;
end;
end;
end;
end;
end;
end;
end.
uses wincrt;
var
a,b,c :array [1..10,1..10] of integer;
i,j,h, baris1, kolom1, baris2, kolom2:integer;
begin
readln(baris1);
readln(kolom1);
begin
for i:=1 to baris1 do
for j:=1 to kolom1 do
readln (a[i,j]);
writeln;
begin
readln (baris2);
readln (kolom2);
for i:=1 to baris2 do
for j:=1 to kolom2 do
readln (b[i,j]);
end;
begin
for i:=1 to baris1 do
begin
for j:=1 to kolom2 do
begin
c[i,j]:=0;
c[i,j]:=c[i,j]+a[i,j]+b[i,j];
write (c[i,j]:2,' ');
end;
writeln;
end;
begin
begin
for i:=1 to baris1 do
begin
for j:=1 to kolom2 do
begin
c[i,j]:=0;
c[i,j]:=c[i,j]+a[i,j]-b[i,j];
write (c[i,j]:2,' ');
end;
writeln;
end;
begin
for i:=1 to baris1 do
begin
for j:=1 to kolom2 do
begin
c[i,j]:=0;
for h:=1 to kolom1 do
c[i,j]:=c[i,j]+a[i,h]*b[h,j];
write (c[i,j]:2,' ');
end;
writeln;
end;
end;
end;
end;
end;
end;
end.
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar