Найти максимальный элемент массива A(N,M) — Basic(Бейсик)

INPUT "N=", N
INPUT "m=", M
DIM A(N, M)
 
FOR i=1 TO N
    FOR j=1 TO M
        A(i,j) = FIX(RND * 11 - 5)
    NEXT
NEXT
 
max = A(1,1)
FOR i = 1 TO N
    FOR i=1 TO M
        IF A(i,j) > max THEN max = A(i,j)
                NEXT
             NEXT
 PRINT "max(A) = ";  max

Leave a Comment