CLS
n = 30
DIM a(n)
FOR i = 1 TO n
PRINT "vvedite element"; i
INPUT a(i)
NEXT
max = -1E+38: min = 1E+38
FOR i = 1 TO n
IF a(i) < 0 AND a(i) > max THEN max = a(i)
IF a(i) > 0 AND a(i) < min THEN min = a(i)
NEXT
CLS
FOR i = 1 TO n
PRINT a(i);
NEXT
PRINT
PRINT "max = "; max
PRINT "min ="; min
Тестирование выполнено в программе QB64 ( Скачать )