CLS
N = 10
DIM M(N)
PRINT "Massiv:"
FOR I = 1 TO N
M(I) = INT(RND * 100)
PRINT M(I);
NEXT I
FOR I = 1 TO N - 1
FOR J = I + 1 TO N
IF (M(I) > M(J)) THEN SWAP M(I), M(J)
NEXT J
NEXT I
PRINT
PRINT "Sort massiv:"
FOR I = 1 TO N
PRINT M(I);
NEXT I
Тестирование выполнено в программе QB64 ( Скачать )