主题:儿子参加一个BASIC培训,有许多题不会做,请教高手(3)
REM Test33
DIM a(5,5) AS INTEGER
FOR i=1 TO 5
FOR j=1 TO 5
a(i,j)=i*10+j
NEXT j,i
FOR k=1 TO 5
a(k,k)=6-k
a(k,6-k)=6-k
NEXT k
FOR i=1 TO 5
FOR j=1 TO 5
PRINT USING "####";a(i,j);
NEXT j
PRINT
NEXT i
END
本题的运行结果是:
DIM a(5,5) AS INTEGER
FOR i=1 TO 5
FOR j=1 TO 5
a(i,j)=i*10+j
NEXT j,i
FOR k=1 TO 5
a(k,k)=6-k
a(k,6-k)=6-k
NEXT k
FOR i=1 TO 5
FOR j=1 TO 5
PRINT USING "####";a(i,j);
NEXT j
NEXT i
END
本题的运行结果是: