(来学网)有程序:INTEGER M(3,3)
DATA M/1,2,3,4,5,6,7,8,9/
DO 10 I=1.3
DO 10 J=1,3
K=M(I,J)
M(I,J)=M(J,I)
M(J,I)=K
10 CONTINUE
WRITE(*,100)((M(I,J),J=1,3),I=1,3)
100 FORMAT(1x,3I2)
END
此程序执行后的结果为:
- A.
(来学网)1 4 7
2 5 8
3 6 9
- B.
(来学网)1 2 3
4 5 6
7 8 9
- C.
(来学网)9 6 3
8 5 2
7 4 1
- D.
(来学网)7 8 9
4 5 6
1 2 3