INPUT "vvedite kolichestvo elementov N ", m
INPUT "vvedite chislo n ", n
DIM a(m)
FOR i = 1 TO m
INPUT "vvedite element ", a(i)
NEXT
PRINT "massiv"
FOR i = 1 TO m
PRINT a(i);
NEXT
PRINT
min = 1E+38
FOR i = 1 TO m
IF ABS(a(i) = n) < min THEN min = ABS(a(i) - n): t = a(i): nomer = i
NEXT
PRINT "blijajshiy element="; t; " ego nomer="; nomer
Тестирование выполнено в программе QB64 ( Скачать )