INPUT "vvedite N ", n
DIM v(n, n)
RANDOMIZE TIMER
FOR i = 1 TO n
FOR j = 1 TO n
v(i, j) = INT(RND * 100) - 50
NEXT
NEXT
PRINT "massiv"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT v(i, j);
NEXT
PRINT
NEXT
FOR i = 1 TO n
IF v(i, i) > 0 THEN min = v(i, i)
NEXT
FOR i = 1 TO n
IF v(i, i) > 0 AND v(i, i) < min THEN min = v(i, i)
NEXT
PRINT "min="; min
Следующий вариант
INPUT "vvedite N ", n
DIM v(n, n)
FOR i = 1 TO n
FOR j = 1 TO n
INPUT "vvedite element ", v(i, j)
NEXT
NEXT
PRINT "massiv"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT v(i, j);
NEXT
PRINT
NEXT
FOR i = 1 TO n
IF v(i, i) > 0 THEN min = v(i, i)
NEXT
FOR i = 1 TO n
IF v(i, i) > 0 AND v(i, i) < min THEN min = v(i, i)
NEXT
PRINT "min="; min
Тестирование выполнено в программе QB64 ( Скачать )