Var i,temp,pol,minA,min:integer; a:array[1..5] of integer; begin minA:=a[1]; for i:=1 to 5 do begin readln(a[i]); if(a[i]<minA)then begin min:=i; minA:=a[i]; end; if(a[i]>0)and (temp=0)then begin pol:=i; temp:=1; end; end; temp:=a[min]; a[min]:=a[pol]; a[pol]:=temp; for i:=1 to 5 do write(a[i],' '); end.
N, i, m, ind, x: integer; a: array [1..1000] of integer; begin readln(n); for i:= 1 to n do read(a[i]); m:=maxint; for i:= 1 to n do if (a[i]<m) then begin m:=a[i]; ind:=i; end; for i:= 1 to n do if (a[i]>0) then begin x:=a[i]; a[i]:=m; a[ind]:=x; break; end; for i := 1 to n do write(a[i], ' '); readln; end. Держи
a:array[1..5] of integer;
begin
minA:=a[1];
for i:=1 to 5 do begin
readln(a[i]);
if(a[i]<minA)then begin min:=i; minA:=a[i]; end;
if(a[i]>0)and (temp=0)then begin pol:=i; temp:=1; end;
end;
temp:=a[min];
a[min]:=a[pol];
a[pol]:=temp;
for i:=1 to 5 do write(a[i],' '); end.
a: array [1..1000] of integer;
begin
readln(n);
for i:= 1 to n do
read(a[i]);
m:=maxint;
for i:= 1 to n do
if (a[i]<m) then begin
m:=a[i];
ind:=i;
end;
for i:= 1 to n do
if (a[i]>0) then begin
x:=a[i];
a[i]:=m;
a[ind]:=x;
break;
end;
for i := 1 to n do
write(a[i], ' ');
readln;
end.
Держи