CLS
DEFINT K, X, Y
INPUT "Vvedite kol-vo stolbcov: "; x
INPUT "Vvedite kol-vo strok: "; y
DIM Ar(1 TO x, 1 TO y) AS INTEGER
RANDOMIZE TIMER
FOR i = 1 TO x
FOR j = 1 TO y
Ar(i, j) = INT(RND * 10)
PRINT Ar(i, j)
NEXT j
NEXT i
k = 0
FOR i = 1 TO x
FOR j = 1 TO y - 1
IF Ar(i, j) = Ar(i, j + 1) THEN
k = k + 1
END IF
NEXT j
NEXT i
PRINT "Kolichestvo par v stolbcah = "; k
END
Тестирование выполнено в программе QB64 ( Скачать )