CLS
N = 18
DATA
42,33,34,35,36,37,38,39,40,41,44,55,65,75,88,90,100,110
DIM
M1(18)
DIM
M2(18)
K = 0
F = 1
READ
M1(1)
PRINT
M1(1);
FOR i =
2 TO N
READ
M1(i)
PRINT
M1(i);
IF M1(1)
< M1(i) AND F = 1 THEN
K = K +
1
M2(K) =
M1(1)
K = K +
1
M2(K) =
M1(i)
F = 0
ELSE
K = K +
1
M2(K) =
M1(i)
END IF
NEXT i
IF F = 1
THEN
M2(N) =
M1(1)
END IF
PRINT
FOR i =
1 TO N
PRINT
M2(i);
NEXT i