Проверить, является ли данная квадратная матрица симметричной (относительно главной диагонали). заметим, что в этом случае для симметричных элементов выполняется условие: a(i, j)=a(j,)
CLS RANDOMIZE TIMER INPUT "n = ", n DIM A(n, n) PRINT "1 - BBECTI ELEMENTbI C KLABbI" PRINT "2 - RANDOM" INPUT BBOD IF BBOD = 2 THEN FOR i = 1 TO n FOR j = 1 TO n A(i, j) = RND * 21 - 10 NEXT j NEXT i ELSE FOR i = 1 TO n FOR j = 1 TO n PRINT "A["; i; ","; j; "] = "; INPUT "", A(i, j) NEXT j NEXT i END IF CLS FOR i = 1 TO n FOR j = 1 TO n PRINT USING "###.##"; A(i, j); PRINT " "; NEXT j PRINT NEXT i C = 1 FOR i = 1 TO n FOR j = 1 TO n IF A(i, j) <> A(j, i) THEN C = 0 END IF NEXT j NEXT i IF C = 1 THEN PRINT "DA" ELSE PRINT "NET" END IF END
RANDOMIZE TIMER
INPUT "n = ", n
DIM A(n, n)
PRINT "1 - BBECTI ELEMENTbI C KLABbI"
PRINT "2 - RANDOM"
INPUT BBOD
IF BBOD = 2 THEN
FOR i = 1 TO n
FOR j = 1 TO n
A(i, j) = RND * 21 - 10
NEXT j
NEXT i
ELSE
FOR i = 1 TO n
FOR j = 1 TO n
PRINT "A["; i; ","; j; "] = ";
INPUT "", A(i, j)
NEXT j
NEXT i
END IF
CLS
FOR i = 1 TO n
FOR j = 1 TO n
PRINT USING "###.##"; A(i, j);
PRINT " ";
NEXT j
PRINT
NEXT i
C = 1
FOR i = 1 TO n
FOR j = 1 TO n
IF A(i, j) <> A(j, i) THEN
C = 0
END IF
NEXT j
NEXT i
IF C = 1 THEN
PRINT "DA"
ELSE
PRINT "NET"
END IF
END