PRINT "vvedite kol-vo"
INPUT n
DIM a(n)
FOR i = 1 TO n
INPUT "vvedite element ", a(i)
NEXT
PRINT "ishodnyj massiv"
FOR i = 1 TO n
PRINT a(i); " ";
NEXT
FOR i = 1 TO n - 1
b(i) = a(i) - a(n)
NEXT
PRINT
PRINT "poluchennyj massiv"
FOR i = 1 TO n - 1
PRINT b(i); " ";
NEXT
FOR i = 1 TO n - 1
FOR j = 2 TO n - 1
IF b(j) < b(j - 1) THEN SWAP b(j), b(j - 1)
NEXT
NEXT
PRINT
PRINT "vozrastanie"
FOR i = 1 TO n - 1
PRINT b(i); " ";
NEXT
Результат работы программы
Тестирование выполнено в программе QB64 ( Скачать )