Product

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
p, q, r, i, k, j: integer;
a,b,c: array[1..100,1..100] of integer;
begin
reset(input, 'product.in');
rewrite(output, 'product.out');
read(p);
read(q);
readln(r);
for i:= 1 to p do
begin
for k:= 1 to q do
begin
read(a[i,k]);
end;
readln;
end;
for i:= 1 to q do
begin
for k:= 1 to r do
begin
read(b[i,k]);
end;
readln;
end;
for i:= 1 to p do
begin
for k:= 1 to r do
begin
j:= 1;
repeat
begin
c[i,k]:= c[i,k] + (a[i,j]* b[j,k]);
j:= j + 1;
end
until j = q + 1;
end;
end;
for i:= 1 to p do
begin
for k:= 1 to r do
begin
write(c[i,k]);
write(' ');
end;
writeln;
end;
{ TODO -oUser -cConsole Main : Insert code here }
end.