Ответ:
program sort;
uses crt;
const n=10;
var m,k:array[1..n] of integer;
i,j:integer;
tmp,ln:integer;
Begin
clrscr;
writeln('Vedit massiv');
for i:=1 to n do
read(m);
for i:=1 to n-1 do
if odd(m) then
for j:=i+1 to n do
if odd(m[j]) and (m[j] > m) then
begin
tmp:=m;
m:=m[j];
m[j]:=tmp;
end;
writeln('vidsort mas');
writeln(m,' ');
readkey
end.
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
program sort;
uses crt;
const n=10;
var m,k:array[1..n] of integer;
i,j:integer;
tmp,ln:integer;
Begin
clrscr;
writeln('Vedit massiv');
for i:=1 to n do
read(m);
for i:=1 to n-1 do
if odd(m) then
for j:=i+1 to n do
if odd(m[j]) and (m[j] > m) then
begin
tmp:=m;
m:=m[j];
m[j]:=tmp;
end;
writeln('vidsort mas');
for i:=1 to n do
writeln(m,' ');
readkey
end.
Объяснение: