Ответ:
pascal
Объяснение:
program z_1;
var
i, minz, maxz: integer;
a: array[1..30] of integer;
begin
minz := 10000;
maxz := 0;
WriteLn('Введите элементы массива от 0 до 10000:');
for i := 1 to 30 do
repeat
Write('a[', i, ']= '); ReadLn(a[i]);
until (a[i] >= 0) and (a[i] <= 10000);
if (a[i] mod 2 = 0) and (a[i] < minz) then minz := a[i];
if (a[i] mod 2 = 0) and (a[i] > maxz) then maxz := a[i];
end;
WriteLn('Минимальный четный элемент массива равен ', minz);
WriteLn('Максимальный четный элемент массива равен ', maxz);
end.
program z_2;
i, maxz: integer;
if (a[i] mod 5 = 0) and (a[i] > maxz) then maxz := a[i];
WriteLn('Максимальный элемент массива, кратный 5, равен ', maxz);
program z_3;
i, minc, minn, s: integer;
minc := 10001;
minn := 10001;
if (a[i] mod 2 = 0) and (a[i] < minc) then minc := a[i];
if (a[i] mod 2 = 1) and (a[i] < minn) then minn := a[i];
if minc = 10001 then minc := 0;
if minn = 10001 then minn := 0;
s := minc + minn;
for i := 30 downto 1 do
if a[i] > s then a[i] := a[i] - s;
WriteLn(a[i]);
end
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
pascal
Объяснение:
program z_1;
var
i, minz, maxz: integer;
a: array[1..30] of integer;
begin
minz := 10000;
maxz := 0;
WriteLn('Введите элементы массива от 0 до 10000:');
for i := 1 to 30 do
begin
repeat
Write('a[', i, ']= '); ReadLn(a[i]);
until (a[i] >= 0) and (a[i] <= 10000);
if (a[i] mod 2 = 0) and (a[i] < minz) then minz := a[i];
if (a[i] mod 2 = 0) and (a[i] > maxz) then maxz := a[i];
end;
WriteLn('Минимальный четный элемент массива равен ', minz);
WriteLn('Максимальный четный элемент массива равен ', maxz);
end.
program z_2;
var
i, maxz: integer;
a: array[1..30] of integer;
begin
maxz := 0;
WriteLn('Введите элементы массива от 0 до 10000:');
for i := 1 to 30 do
begin
repeat
Write('a[', i, ']= '); ReadLn(a[i]);
until (a[i] >= 0) and (a[i] <= 10000);
if (a[i] mod 5 = 0) and (a[i] > maxz) then maxz := a[i];
end;
WriteLn('Максимальный элемент массива, кратный 5, равен ', maxz);
end.
program z_3;
var
i, minc, minn, s: integer;
a: array[1..30] of integer;
begin
minc := 10001;
minn := 10001;
WriteLn('Введите элементы массива от 0 до 10000:');
for i := 1 to 30 do
begin
repeat
Write('a[', i, ']= '); ReadLn(a[i]);
until (a[i] >= 0) and (a[i] <= 10000);
if (a[i] mod 2 = 0) and (a[i] < minc) then minc := a[i];
if (a[i] mod 2 = 1) and (a[i] < minn) then minn := a[i];
end;
if minc = 10001 then minc := 0;
if minn = 10001 then minn := 0;
s := minc + minn;
for i := 30 downto 1 do
begin
if a[i] > s then a[i] := a[i] - s;
WriteLn(a[i]);
end
end.