结束 3.源程序(18分) PROGRAM MAIN DIMENSIONA(3.3).B(3).X(3).JS(3) DOUBLE PRECISION A.B.X.EPS.MI.M2.M3.C.V1.V2 INTEGER IN N同 EPS=1.0D-06 OPEN(6 FILE-TESTD TXT STATUS-UNKNOWN) DO 10I=1.N 10 A(1=I DATA M1105.989/,M2/84.007,M3/39.9971 DATA C/0.1025/,V1/12.31/,V2/31.25 A(2,1)=I/MI A(22)1=0 A23=1M3 A3,1)=2M A3,2-1M2 A(3,3F1M3 B1=0.2 B2=C*V1/1000 B31=C*V2/1000 WRITE(6,*YORIGINAL LINEAR EQUATIONS: WRITE(6.1IX(A(IJ)J=1.N).I=1.N) FORMAT(1X.3F10.4) WRITE(6,12B④,I=1,N FORMATOX F104) CALLGS(A.B.N.X.LJS) WRITE(6.2) FORMAT(/5X,'SOLUTION:C=/) WRITE(6,33I,X),=1,N) 33 FORMAT(5X.'C,I2,=,D12.4.g) END SUBROUTINE GS(A.B.N,X,L.JS) DIMENSION A(N.N).X(N).B(N).JS(N) DOUBLE PRECISION A.B.X,T3. 源程序(18 分) PROGRAM MAIN DIMENSION A(3,3),B(3),X(3),JS(3) DOUBLE PRECISION A,B,X,EPS,M1,M2,M3,C,V1,V2 INTEGER I,N N=3 EPS=1.0D-06 OPEN(6,FILE='TESTD.TXT',STATUS='UNKNOWN') DO 10 I=1,N 10 A(1,I)=1 DATA M1/105.989/,M2/84.007/,M3/39.9971/ DATA C/0.1025/,V1/12.31/,V2/31.25/ A(2,1)=1/M1 A(2,2)=0 A(2,3)=1/M3 A(3,1)=2/M1 A(3,2)=1/M2 A(3,3)=1/M3 B(1)=0.2 B(2)=C*V1/1000 B(3)=C*V2/1000 WRITE(6,*)'ORIGINAL LINEAR EQUATIONS:' WRITE(6,11)((A(I,J),J=1,N),I=1,N) 11 FORMAT(1X,3F10.4) WRITE(6,12)(B(I),I=1,N) 12 FORMAT(1X,F10.4) CALL GS(A,B,N,X,L,JS) WRITE(6,22) 22 FORMAT(/5X,'SOLUTION: C='/) WRITE(6,33)(I,X(I),I=1,N) 33 FORMAT(5X,'C',I2,'=',D12.4,'g') END SUBROUTINE GS(A,B,N,X,L,JS) DIMENSION A(N,N),X(N),B(N),JS(N) DOUBLE PRECISION A,B,X,T 结束