[問題] 關於3*3 Cramer Rule

看板Fortran作者 (Leo)時間11年前 (2013/04/29 20:43), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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
文章代碼(AID): #1HVchT0q (Fortran)
文章代碼(AID): #1HVchT0q (Fortran)