CLS
n=3:m=2
DIM a(n,m)
RANDOMIZE TIMER
FOR i=1 TO n
FOR j=1 TO m
a(i,j)=INT(RND*21)-10
NEXT j
NEXT i
PRINT "Matrica"
FOR i=1 TO n
FOR j=1 TO m
PRINT a(i,j);
NEXT j
PRINT
NEXT i
PRINT
max=a(1,1)
FOR i=1 TO n
FOR j=1 TO m
IF a(i,j)>max THEN max=a(i,j)
NEXT j
NEXT i
k=0
FOR i=1 TO n
FOR j=1 TO m
IF a(i,j)=max THEN k=k+1
NEXT j
NEXT i
PRINT "Maksimalniy element=";max
PRINT "on vstrchaetsya ";k;" raz"
Тестирование выполнено в программе QB64 ( Скачать )