楼主:
terryys (terry)
2012-11-30 10:30:23module testmod
implicit none
contains
function a(x)
real :: a
real, intent(in) :: x
a=x**2.
end function
function b(x)
real :: b
real, intent(in) :: x
b=(x+6.)/a(x)
end function
end module
program testpro
use testmod
implicit none
print *, b(12.)
end
可以正常执行,输出0.125也是正确的答案
你的B里面宣告了另一个a,ifort和gfortran都不能编译
试试把那个a删掉?