Объяснение:
1. x = 0; y = 4
Цикл по i от 3 до 6
1) i = 3
x = x + 1 = 0 + 1 = 1
y = y + 2 = 4 + 2 = 6
2) i = 4
x = x + 1 = 1 + 1 = 2
y = y + 2 = 6 + 2 = 8
3) i = 5
x = x + 1 = 2 + 1 = 3
y = y + 2 = 8 + 2 = 10
4) i = 6
x = x + 1 = 3 + 1 = 4
y = y + 2 = 10 + 2 = 12
Конец цикла
y = y - x = 12 - 4 = 8
x = x + y = 4 + 8 = 12
Вывод y = 8
2. x = 0; y = 2
Цикл, пока y < 15
1) x = x + 1 = 0 + 1 = 1
y = y + 2 = 2 + 2 = 4 < 15
2) x = 1 + 1 = 2
y = 4 + 2 = 6 < 15
3) x = 2 + 1 = 3
y = 6 + 2 = 8 < 15
4) x = 3 + 1 = 4
y = 8 + 2 = 10 < 15
5) x = 4 + 1 = 5
y = 10 + 2 = 12 < 15
6) x = 5 + 1 = 6
y = 12 + 2 = 14 < 15
7) x = 6 + 1 = 7
y = 14 + 2 = 16 > 15
y = y - x = 16 - 7 = 9
x = x + y = 7 + 9 = 16
Вывод y = 9
3. x = 0; y = 5
Цикл с постусловием
y = y + 2 = 5 + 2 = 7
Выйти из цикла, если y > 15
y = 7 < 15
y = 7 + 2 = 9 < 15
y = 9 + 2 = 11 < 15
y = 11 + 2 = 13 < 15
y = 13 + 2 = 15
15 не больше 15, поэтому продолжаем.
y = 15 + 2 = 17 > 15
Выход из цикла
y = y - x = 17 - 6 = 11
x = x + y = 6 + 11 = 17
Вывод y = 11
const
n = 7;
m = 6;
var
A, b: array[1..n, 1..m] of integer;
i, j, max, min: integer;
begin
writeln('Исходный массив:');
randomize;
for i := 1 to n do
for j := 1 to m do
a[i, j] := random(10) + 3;
write(a[i, j]:5)
end;
writeln;
writeln('Максимальный элемент каждого столбца:');
max := -Maxint;
if max < a[i, j] then
max := a[i, j];
write(max:5)
min := Maxint;
if min > a[i, j] then
min := a[i, j];
b[i, j] := a[i, j] - min;
writeln('Новый массив:');
write(b[i, j]:5);
end.
0
я руский
Объяснение:
1. x = 0; y = 4
Цикл по i от 3 до 6
1) i = 3
x = x + 1 = 0 + 1 = 1
y = y + 2 = 4 + 2 = 6
2) i = 4
x = x + 1 = 1 + 1 = 2
y = y + 2 = 6 + 2 = 8
3) i = 5
x = x + 1 = 2 + 1 = 3
y = y + 2 = 8 + 2 = 10
4) i = 6
x = x + 1 = 3 + 1 = 4
y = y + 2 = 10 + 2 = 12
Конец цикла
y = y - x = 12 - 4 = 8
x = x + y = 4 + 8 = 12
Вывод y = 8
2. x = 0; y = 2
Цикл, пока y < 15
1) x = x + 1 = 0 + 1 = 1
y = y + 2 = 2 + 2 = 4 < 15
2) x = 1 + 1 = 2
y = 4 + 2 = 6 < 15
3) x = 2 + 1 = 3
y = 6 + 2 = 8 < 15
4) x = 3 + 1 = 4
y = 8 + 2 = 10 < 15
5) x = 4 + 1 = 5
y = 10 + 2 = 12 < 15
6) x = 5 + 1 = 6
y = 12 + 2 = 14 < 15
7) x = 6 + 1 = 7
y = 14 + 2 = 16 > 15
Конец цикла
y = y - x = 16 - 7 = 9
x = x + y = 7 + 9 = 16
Вывод y = 9
3. x = 0; y = 5
Цикл с постусловием
1) x = x + 1 = 0 + 1 = 1
y = y + 2 = 5 + 2 = 7
Выйти из цикла, если y > 15
y = 7 < 15
2) x = 1 + 1 = 2
y = 7 + 2 = 9 < 15
3) x = 2 + 1 = 3
y = 9 + 2 = 11 < 15
4) x = 3 + 1 = 4
y = 11 + 2 = 13 < 15
5) x = 4 + 1 = 5
y = 13 + 2 = 15
15 не больше 15, поэтому продолжаем.
6) x = 5 + 1 = 6
y = 15 + 2 = 17 > 15
Выход из цикла
y = y - x = 17 - 6 = 11
x = x + y = 6 + 11 = 17
Вывод y = 11
const
n = 7;
m = 6;
var
A, b: array[1..n, 1..m] of integer;
i, j, max, min: integer;
begin
writeln('Исходный массив:');
randomize;
for i := 1 to n do
begin
for j := 1 to m do
begin
a[i, j] := random(10) + 3;
write(a[i, j]:5)
end;
writeln;
end;
writeln('Максимальный элемент каждого столбца:');
for j := 1 to m do
begin
max := -Maxint;
for i := 1 to n do
if max < a[i, j] then
max := a[i, j];
write(max:5)
end;
writeln;
for j := 1 to m do
begin
min := Maxint;
for i := 1 to n do
if min > a[i, j] then
min := a[i, j];
for i := 1 to n do
b[i, j] := a[i, j] - min;
end;
writeln('Новый массив:');
for i := 1 to n do
begin
for j := 1 to m do
write(b[i, j]:5);
writeln;
end;
end.
0
Объяснение:
я руский