作者dana79810 (kicala)
看板Fortran
标题[问题] 好像是字元逻辑的问题..
时间Fri May 29 03:27:29 2009
出现 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
1F:→ GPS5566:你的第一行就是答案了...(题外话 simspon = 辛氏积分??) 05/29 04:07
2F:→ Yagyu:(skill=="i") 05/29 04:11
3F:→ dana79810:不好意识唷..其实我不知道要如何改 05/29 12:20
4F:→ dana79810:给二楼,加"AA"还是叫不出来耶.. 05/29 12:40
5F:推 charlesdc:i,j,k没给值他是要怎麽比对? 要依照你skill给什麽吧 05/29 18:05
6F:→ dana79810:我懂了!!! 谢谢唷 05/29 19:03