DIM a(10)
FOR i = 1 TO 10
a(i) = INT(RND * 3)
NEXT
PRINT "ishodnyj massiv"
FOR i = 1 TO 10
PRINT a(i); " ";
NEXT
PRINT
FOR i = 1 TO 10
FOR j = 2 TO 10
IF a(j) > a(j - 1) THEN SWAP a(j), a(j - 1)
NEXT
NEXT
PRINT "otsortirovannyj massiv"
FOR i = 1 TO 10
PRINT a(i); " ";
NEXT