CLS
INPUT "strok:", m
INPUT "stolbcov:", n
DIM A(n, m), Opr, MaxInMin, Mx, My
' Generiruem maricu
RANDOMIZE TIMER
FOR iy = 1 TO m: FOR ix = 1 TO n
A(ix, iy) = INT(RND * 101) - 50
PRINT A(ix, iy);
NEXT: PRINT: NEXT
' Poisk
FOR iy = 1 TO m: FOR ix = 1 TO n
IF A(ix, iy) < 0 THEN
IF Opr = 0 THEN
MaxInMin = A(ix, iy): Mx = ix: My = iy: Opr = 1
ELSE:
IF A(ix, iy) > MaxInMin THEN MaxInMin = A(ix, iy): Mx = ix: My = iy
END IF
END IF
NEXT: NEXT
' Vivod rezultata
IF Opr = 1 THEN
PRINT "Znacheniye:"; MaxInMin
PRINT "Stroka"; My
PRINT "Stolbec"; Mx
ELSE
PRINT "Netu ni odnogo otricatelnogo elementa"
END IF