cls
dim a(5,5)
for i = 1 to 5
for j=1 to 5
cls
print "a("; i; ",";j; ")=";
input a(i,j)
next j
next i
for i=1 to 5
if a(i,i)<0 then s=s+a(i,i)
next i
CLS
n = 5
DIM a(n, n)
FOR i = 1 TO n: FOR j = 1 TO n
PRINT "vvedite a("; i; ","; j; ")";
INPUT a(i, j)
NEXT: NEXT
FOR i = 1 TO n
IF a(i, i) < 0 THEN k = k + 1
NEXT
FOR i = 1 TO n: FOR j = 1 TO n
PRINT a(i, j);
NEXT: PRINT: NEXT
PRINT "k ="; k
Тестирование выполнено в программе QB64 ( Скачать )