主题:小弟初学者,哪位大神能帮我看一下这段代码运行时红色部分为什么会出错
program ex01
implicit none
interface
elemental real function func(num)
implicit none
real,intent(in) ::num
end function
end interface
integer i
real::a(10)=(/(i,i=1,10)/)
real::b(10)
write(*,"(10f6.2)")a
a=func(a)
write(*,"(10f6.2)")a
end program
elemental real function func(num)
implicit none
real,intent(in)::num
func=sin(num)+cos(num)
return
end function
implicit none
interface
elemental real function func(num)
implicit none
real,intent(in) ::num
end function
end interface
integer i
real::a(10)=(/(i,i=1,10)/)
real::b(10)
write(*,"(10f6.2)")a
a=func(a)
write(*,"(10f6.2)")a
end program
elemental real function func(num)
implicit none
real,intent(in)::num
func=sin(num)+cos(num)
return
end function