Const
N = 13;
Var
A:array[1..N] of integer;
i,Min:integer;
Begin
Randomize;
Min:=1;
For i:= 1 to N do
Begin
A[i]:=random(2*N+1)-N;
Write(A[i],' ');
if A[Min]>A[i] then Min:=i;
End;
WriteLn;
WriteLn(Min)
End.
Const
N = 13;
Var
A:array[1..N] of integer;
i,j,Min,B:integer;
Begin
Randomize;
For i:= 1 to N do
Begin
A[i]:=random(2*N+1)-N;
Write(A[i],' ');
End;
WriteLn;
WriteLn;
For i:= 1 to N do
Begin
Min:=i;
For j:=i+1 to N do
if A[Min]>A[j] then Min:=j;
B:=A[Min];
A[Min]:=A[i];
A[i]:=B;
Write(A[i],' ')
End;
End.
Const
N = 13;
Var
A:array[1..N] of integer;
i,j,Max,B:integer;
Begin
Randomize;
For i:= 1 to N do
Begin
A[i]:=random(2*N+1)-N;
Write(A[i],' ');
End;
WriteLn;
WriteLn;
For i:= 1 to N do
Begin
Max:=i;
For j:=i+1 to N do
if A[Max] B:=A[Max];
A[Max]:=A[i];
A[i]:=B;
Write(A[i],' ')
End;
End.