[問題] 關於3*3 Cramer Rule
Program PDE_BV_Problem
Implicit None
!-------------------------
!Solve the PDE-based boundary value problem utilizing Cramer's rule
!-------------------------
!Name:QQ
!Student Id number:1234
!Date:2013.04.24
!-------------------------
double precision A(1:1000,1:1000)
double precision B(1:1000)
double precision X(1:1000)
double precision det_A,det_AI
Integer I
!---
1&
Write(*,*)"please input the values of A(1,1),A(1,2),A(1,3):"
Read(*,*)A(1,1),A(1,2),A(1,3)
Write(*,*)"please input the values of A(2,1),A(2,2),A(2,3):"
Read(*,*)A(2,1),A(2,2),A(2,3)
Write(*,*)"please input the values of A(3,1),A(3,2),A(3,3):"
Read(*,*)A(3,1),A(3,2),A(3,3)
Write(*,*)"please input the values of B(1),B(2),B(3):"
Read(*,*)B(1),B(2),B(3)
!---
det_A=(A(1,1)*A(2,2)*A(3,3)+A(1,2)*A(2,3)*A(3,1)+A(1,3)*A(2,1)*A(3,2))-(A(1,1)*A(2,3)*A(3,2)+A(1,2)*A(2,1)*A(3,3)+A(1,3)*A(2,2)*A(3,1))
DO I=1,3,1
IF(I.EQ.1)Then
det_AI=(B(1)*A(2,2)*A(3,3)+A(1,2)*A(2,3)*B(3)+A(1,3)*B(2)*A(3,2))-(B(1)*A(2,3)*A(3,2)+A(1,2)*B(2)*A(3,3)+A(1,3)*A(2,2)*B(3))
else if(I.EQ.2)Then
det_AI=(A(1,1)*B(2)*A(3,3)+B(1)*A(2,3)*A(3,1)+A(1,3)*A(2,1)*B(3))-(A(1,1)*A(2,3)*B(3)+B(1)*A(2,1)*A(3,3)+A(1,3)*B(2)*A(3,1))
else if (I.EQ.3)Then
det_AI=(A(1,1)*A(2,2)*B(3)+A(1,2)*B(2)*A(3,1)+B(1)*A(2,1)*A(3,2))-(A(1,1)*B(2)*A(3,2)+A(1,2)*A(2,1)*B(3)+B(1)*A(2,2)*A(3,1))
end if
X(I)=det_AI/det_A
write(*,fmt="(A6,I1,A2,F10.4)")"X(",I,")=",X(I)
end do
goto 1
end program PDE_BV_Problem
我想打一個3*3的Cramer Rule 只是按Run後顯示出
C:\Users\Lab\Documents\33.F90(26) : error 58 - Unpaired right bracket(s)
C:\Users\Lab\Documents\33.F90(42) : warning 684 - There are (at least) 2
truncated line(s) in this file
的錯誤 不知要如何修正才能讓這個程式執行
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.135.96.146
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章