Fortran中这句if语句如何理解?
1个回答

这是Fortran中Arithmetic IF Statement即算术if语句,它的含义就是:当if中的值,分别是 0时,按相应顺序goto到后面的语句.具体到你的例子,就是:当a < 0时, goto 120

当 a >=0时,goto 100比如:read(*,*) a

if (a) 120, 100, 100

120 print *, "< 0"

print *, "---"

goto 200

100 print *, ">= 0"

200 continue运行结果:-1

< 0

---而1

>= 0