主要记录if语句和do语句的多种写法
先来看一个普通的if 语句
subroutine if
integer :: i , m
i = 5
if (i>1) then
m = i
end if
end
当 if代码段只有一条执行语句时,可以简化成
subroutine simplify-if
integer :: i , m
i = 5
if (i>1) m = i
end
do语句的两种写法
写法一:
subroutine do-1
integer :: i
do i = 1,5
.........
.........
.........
end do
end
写法二:
subroutine do-2
integer :: i
do 700 i = 1,5
.........
.........
.........
700 continue
end
这两种写法意义相同