function f(x,y)
f=y-2*x/y
end
program main
real*8 y(0:200),x(0:200)
dx=0.1
x(0)=0.0
y(0)=1.0
do 10 k=0,10
k1= f(x(k),y(k))
k2=f(x(k)+dx/2,y(k)+dx*k1/2)
k3=f(x(k)+dx/2,y(k)+dx*k2/2)
k4=f(x(k)+dx,y(k)+dx*k3)
y(k+1)=y(k)+(k1+k2+k3+k4)*dx/6
x(k)=x(k)+dx
10 write(*,*)x(k),y(k+1)
end
显示错误 error #6633: The type of the actual argument differs from the type of the dummy argument.
f=y-2*x/y
end
program main
real*8 y(0:200),x(0:200)
dx=0.1
x(0)=0.0
y(0)=1.0
do 10 k=0,10
k1= f(x(k),y(k))
k2=f(x(k)+dx/2,y(k)+dx*k1/2)
k3=f(x(k)+dx/2,y(k)+dx*k2/2)
k4=f(x(k)+dx,y(k)+dx*k3)
y(k+1)=y(k)+(k1+k2+k3+k4)*dx/6
x(k)=x(k)+dx
10 write(*,*)x(k),y(k+1)
end
显示错误 error #6633: The type of the actual argument differs from the type of the dummy argument.