[問題] 好像是字元邏輯的問題..
出現 Variable I has been used without being given an initial value
I,J,K都有這樣我沒辦法下去。
跑是可以跑可是附程式叫不出來,拜託前輩們
program intergran sin
implicit none
real::a,b,h,dx
integer::s
character(len=20)::skill,i,j,k
write(*,*)"function:sin key in upper & under "
read(*,*)a,b
h=a-b
write(*,*)"key in how many subintervals ?"
read(*,*)s
dx=h/real(s)
write(*,*)"select a skill "
write(*,*)"(i)simspon rule"
write(*,*)"(j)rectangule rule"
write(*,*)"(k)trapezoidal rule"
read(*,*)skill
----------------------------------
if (skill==i) then 我
call simspon 想
else if(skill==j) then 問
call rectangule 題
else if(skill==k) then 在
call trapezoidal 這
end if
end program
subroutine simspon
implicit none
write(*,*)"integran by simspon rule"
end
subroutine rectangule
implicit none
write(*,*)"integran by rectangule rule"
end
subroutine trapezoidal
implicit none
write(*,*)"integran by trapezoidal rule"
end
謝謝 orz
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.169.151.243
→
05/29 04:07, , 1F
05/29 04:07, 1F
→
05/29 04:11, , 2F
05/29 04:11, 2F
→
05/29 12:20, , 3F
05/29 12:20, 3F
→
05/29 12:40, , 4F
05/29 12:40, 4F
推
05/29 18:05, , 5F
05/29 18:05, 5F
→
05/29 19:03, , 6F
05/29 19:03, 6F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章