INPUT n
DIM a(n)
FOR i = 1 TO n
INPUT a(i)
NEXT
FOR i = 1 TO n
PRINT a(i); " ";
NEXT
FOR i = 2 TO n
a(i) = a(i) - a(1)
NEXT
FOR i = 1 TO n
FOR j = 2 TO n
IF a(i) < a(i - 1) THEN SWAP a(i), a(i - 1)
NEXT
NEXT
PRINT
FOR i = 1 TO n
PRINT a(i); " ";
NEXT
Тестирование выполнено в программе QB64 ( Скачать )