主题:运行时出错了,不知原因,求大神解释
function f(x)result(n)
if(x>-14.178.and.x<=18.757)then
n=1
elseif(x>-56.100.and.x<=-55.400.or.x>-51.700.and.x<=-51.100&
.or. x>-38.100.and.x<=-32.600.or.x>-32.000.and.x<=-30.200&
.or. x>-15.500.and.x<=-12.300)then
n=0
else
n=-1
endif
end
program gz2
real x,a
x=-59.243
print*, x
do while (x<18.757)
a=x
i=f(x)
select case(i)
case(1)
x=x+1.99
case(0)
x=x+1.44
case(-1)
x=x+2.86
end select
print*,x,x-a
end do
end
if(x>-14.178.and.x<=18.757)then
n=1
elseif(x>-56.100.and.x<=-55.400.or.x>-51.700.and.x<=-51.100&
.or. x>-38.100.and.x<=-32.600.or.x>-32.000.and.x<=-30.200&
.or. x>-15.500.and.x<=-12.300)then
n=0
else
n=-1
endif
end
program gz2
real x,a
x=-59.243
print*, x
do while (x<18.757)
a=x
i=f(x)
select case(i)
case(1)
x=x+1.99
case(0)
x=x+1.44
case(-1)
x=x+2.86
end select
print*,x,x-a
end do
end