Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab5;
- var
- n, k, j: integer;
- max: real;
- a, b, x: array[1..15, 1..15] of real;
- begin
- writeln('input n: ');
- readln(n);
- if (n < 1) or (n > 15) then
- writeln('Error: n not in [1, 15].')
- else
- begin
- writeln('input matr a: ');
- for k:=1 to n do
- for j:=1 to n do
- readln(a[k][j]);
- writeln('input matr b: ');
- for k:=1 to n do
- for j:=1 to n do
- readln(b[k][j]);
- for k:=1 to n do
- begin
- max := b[k][1];
- for j:= 2 to n do
- if max < b[k][j] then
- max := b[k][j];
- for j:= 1 to n do
- x[k][j] := a[k][j] * max;
- end;
- for k:=1 to n do
- begin
- for j:=1 to n do
- write(x[k][j]:0:2, ' ');
- writeln;
- end;
- end;
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment