Program swap; const S = 10; {размер массива} var a: array[1..S] of integer; m, m_i, t: integer; procedure GetMin(); var i: integer; begin m := a[1]; for i := 2 to S do if a[i] < m then begin m := a[i]; m_i := i; end; end; begin for t := 1 to S do readln(a[t]); GetMin(); t := a[1]; a[1] := m; a[m_i] := t; for t := 1 to S do write(a[t], ' '); end.
const
S = 10; {размер массива}
var
a: array[1..S] of integer;
m, m_i, t: integer;
procedure GetMin();
var
i: integer;
begin
m := a[1];
for i := 2 to S do
if a[i] < m then
begin
m := a[i];
m_i := i;
end;
end;
begin
for t := 1 to S do
readln(a[t]);
GetMin();
t := a[1];
a[1] := m;
a[m_i] := t;
for t := 1 to S do
write(a[t], ' ');
end.