в первой строке файла пишем размер матрицы,
например
3
2 4 6
1 1 1
6 8 9
INPUT "vvedite nazvanie faila vvoda ", a$
OPEN a$ FOR INPUT AS #1
INPUT #1, n
DIM a(n, n)
FOR i = 1 TO n
FOR j = 1 TO n
INPUT #1, a(i, j)
NEXT
NEXT
CLOSE
PRINT "matrica"
FOR i = 1 TO n
FOR j = 1 TO n
PRINT a(i, j);
NEXT
PRINT
NEXT
INPUT "vvedite nazvanie faila vyvoda ", b$
OPEN b$ FOR OUTPUT AS #2
FOR i = 1 TO n
f = 0
FOR j = 1 TO n
FOR k = 1 TO n
IF a(i, j) <> a(i, k) THEN f = 1
NEXT
NEXT
IF f = 0 THEN PRINT #2, i
NEXT
CLOSE
Тестирование выполнено в программе QB64 ( Скачать )