Fortran程序,矩阵相乘中IF语句:IF(IND) 10,20,20怎么个读取顺序.为什么10,20,SUBROUTINE MXMLT(A,B,C,N,IND)\x05IMPLICIT REAL*8(A-H,O-Z)\x05DIMENSION A(N,1),B(N,1),C(N,1)\x05IF(IND) 10,20,2010\x05CONTINUE\x05DO 100 I=1,N\x05DO 100,J=1,N

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/17 02:36:33
Fortran程序,矩阵相乘中IF语句:IF(IND)10,20,20怎么个读取顺序.为什么10,20,SUBROUTINEMXMLT(A,B,C,N,IND)\x05IMPLICITREAL*8(A

Fortran程序,矩阵相乘中IF语句:IF(IND) 10,20,20怎么个读取顺序.为什么10,20,SUBROUTINE MXMLT(A,B,C,N,IND)\x05IMPLICIT REAL*8(A-H,O-Z)\x05DIMENSION A(N,1),B(N,1),C(N,1)\x05IF(IND) 10,20,2010\x05CONTINUE\x05DO 100 I=1,N\x05DO 100,J=1,N
Fortran程序,矩阵相乘中IF语句:IF(IND) 10,20,20怎么个读取顺序.为什么10,20,
SUBROUTINE MXMLT(A,B,C,N,IND)
\x05IMPLICIT REAL*8(A-H,O-Z)
\x05DIMENSION A(N,1),B(N,1),C(N,1)
\x05IF(IND) 10,20,20
10\x05CONTINUE
\x05DO 100 I=1,N
\x05DO 100,J=1,N
\x05S=0.0D0
\x05DO 200 K=1,N
\x05S=S+A(K,I)*B(K,J)
\x05
200\x05CONTINUE
\x05C(I,J)=S
100\x05CONTINUE
\x05GOTO 500
20\x05CONTINUE
\x05DO 300 I=1,N
\x05DO 300 J=1,N
\x05S=0.0D0
\x05DO 400 K=1,N
\x05S=S+A(I,K)*B(K,J)
\x05
400\x05CONTINUE
\x05C(I,J)=S
300\x05CONTINUE
500\x05CONTINUE
\x05RETURN
\x05END

Fortran程序,矩阵相乘中IF语句:IF(IND) 10,20,20怎么个读取顺序.为什么10,20,SUBROUTINE MXMLT(A,B,C,N,IND)\x05IMPLICIT REAL*8(A-H,O-Z)\x05DIMENSION A(N,1),B(N,1),C(N,1)\x05IF(IND) 10,20,2010\x05CONTINUE\x05DO 100 I=1,N\x05DO 100,J=1,N
IF(IND) 10,20,20
等效于
if ind 0 goto 20
这是老语法,不建议使用