Программа:
Pascal:
var
arr: array[1..12] of integer;
i, j, tmp: integer;
begin
for i := 1 to 12 do arr[i] := random(-50, 50);
for i := 1 to 11 do
for j := i + 1 to 12 do
if arr[i] > arr[j] then begin
tmp := arr[i];
arr[i] := arr[j];
arr[j] := tmp;
end;
writeln(arr);
if arr[3] mod 2 = 0 then writeln('Число чётное')
else writeln('Число нечётное');
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Программа:
Pascal:
var
arr: array[1..12] of integer;
i, j, tmp: integer;
begin
for i := 1 to 12 do arr[i] := random(-50, 50);
for i := 1 to 11 do
for j := i + 1 to 12 do
if arr[i] > arr[j] then begin
tmp := arr[i];
arr[i] := arr[j];
arr[j] := tmp;
end;
writeln(arr);
if arr[3] mod 2 = 0 then writeln('Число чётное')
else writeln('Число нечётное');
end.