INPUT "kol-vo strok=", m
INPUT "kol-vo stolbcov=", n
DIM a(m, n)
RANDOMIZE TIMER
PRINT "massiv"
FOR i = 1 TO m
FOR j = 1 TO n
a(i, j) = INT(RND * 20)
PRINT a(i, j);
NEXT
PRINT
NEXT
minx = 1
miny = 1
maxx = 1
maxy = 1
FOR i = 1 TO m
FOR j = 1 TO n
IF a(i, j) < a(minx, miny) THEN minx = i: miny = j
IF a(i, j) > a(maxx, maxy) THEN maxx = i: maxy = j
NEXT
NEXT
PRINT "max element="; a(maxx, maxy); "stroka="; maxx; "stolbec="; maxy
PRINT "min element="; a(minx, min); "stroka="; minx; "stolbec="; miny
IF maxx = minx THEN PRINT "max i min v odnoy stroke" ELSE PRINT "max i min ne v odnoy stroke"
Тестирование выполнено в программе QB64 ( Скачать )