#include
char main(void)
{
char A[5][5],B[5][5],C[5][5];
int i,j, n = 5, m = 5;
printf(" Array A: ");
printf("\r\n");
srand(time(0));
for (i=0; i {
for (j=0; j {
A[i][j] = rand() %10;
printf("%d ", A[i][j]);
}
printf("\r\n");
}
printf(" Array B: ");
printf("\r\n");
srand(time(0));
for (i=0; i {
for (j=0; j {
B[i][j] =1+ rand() %9;
printf("%d ", B[i][j]);
}
printf("\r\n");
}
printf(" Array C: ");
printf("\r\n");
for (i=0; i {
for (j=0; j {
if (A[i][j]>B[i][j])
C[i][j] = A[i][j];
else
C[i][j] = B[i][j];
printf("%d ", C[i][j]);
}
printf("\r\n");
}
}
//////////////////////////// ПАСКАЛЬ /////////////////////////
Program asd;
Const n=3; m=3;
var A,B,C:array[1..n,1..m] of integer;
i,j:integer;
BEGIN
Writeln('Массив А: ');
For i:=1 to n do
begin
for j:=1 to m do
begin
A[i,j]:=Random(10);
Write(A[i,j]:3);
end;
Writeln;
end;
Writeln;
Writeln('Массив B: ');
For i:=1 to n do
begin
for j:=1 to m do
begin
B[i,j]:=Random(10);
Write(B[i,j]:3);
end;
Writeln;
end;
Writeln;
Writeln('Массив C: ');
For i:=1 to n do
begin
for j:=1 to m do
begin
if A[i,j]>B[i,j] then C[i,j]:=A[i,j]
else C[i,j]:=B[i,j];
Write(C[i,j]:3);
end;
writeln;
end;
END.