主题:请问我的这个程序对吗?能运行
问题
Y=0, u=2*t
X=0, u=3*t
X=762, u=5*t
程序
Program main
Implicit none
Real x,y,t,u
Read(*,*)x,y
t=0.5
IF (y.eq.0) then
u=2*t
ELSE
if (x.eq.0) then
u=3*t
else if (y.eq.0) then
u=5*t
end if
ENDIF
write(*,*)x,y,u
Y=0, u=2*t
X=0, u=3*t
X=762, u=5*t
程序
Program main
Implicit none
Real x,y,t,u
Read(*,*)x,y
t=0.5
IF (y.eq.0) then
u=2*t
ELSE
if (x.eq.0) then
u=3*t
else if (y.eq.0) then
u=5*t
end if
ENDIF
write(*,*)x,y,u