一个Fortran程序的问题

来源:百度知道 编辑:UC知道 时间:2024/05/05 16:00:43
program ex214
implicit none
real x,y,pi
parameter(pi=3.14159)
read*,x
if(x>=-pi.and.x<=0.0)then
y=-(2pi+x)sin(x)
elseif(0<=x.and.x<=pi)then
y=(2pi-x)sin(x)
endif
print*,y
end

求一个分段函数的值
当我运行以后出现
error 773 - Variable PI follows another operand (possible unexpected space?)
error 773 - Variable PI follows another operand (possible unexpected space?)
的提示
请高手指教我错在哪里?
我用的是Silverfrost FTN95

朋友,以后写算式记得写*号。。。。
program ex214
implicit none
real x,y,pi
parameter(pi=3.14159)
read*,x
if(x>=-pi.and.x<=0.0)then
y=-(2*pi+x)*sin(x) //这里两个
elseif(0<=x.and.x<=pi)then
y=(2*pi-x)*sin(x) //这里两个。。。
endif
print*,y
end