目录

cycle

循环语句使循环跳过其剩余的主体,并在重复之前立即重新测试其状态。

流程图

周期表

例子 (Example)

program cycle_example     
implicit none      
   integer :: i     
   do i = 1, 20          
      if (i == 5) then 
         cycle          
      end if         
   print*, i      
   end do  
end program cycle_example

编译并执行上述代码时,会产生以下结果 -

1
2
3
4
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
↑回到顶部↑
WIKI教程 @2018