CLS
RANDOMIZE TIMER
n = 2: m = 3
DIM a(n, m)
FOR i = 1 TO n: FOR j = 1 TO m
a(i, j) = FIX(RND * 100)
NEXT: NEXT
max = a(1, 1)
FOR i = 1 TO n: FOR j = 1 TO m
IF a(i, j) > max THEN max = a(i, j): ki = i: kj = j
NEXT: NEXT
FOR i = 1 TO n: FOR j = 1 TO m
PRINT a(i, j);
NEXT: PRINT: NEXT
PRINT "max ="; max, "a("; ki; ","; kj; ")"
Тестирование выполнено в программе QB64 ( Скачать )