- 17
- 0
- 约3.15千字
- 约 17页
- 2018-05-18 发布于四川
- 举报
3.2 DO循环结构 Counter=11 program ex0601 implicit none integer counter integer, parameter :: lines=10 ! counter=lines之前会一直重复循环 ! 每跑一次循环counter会累加1 do counter=1,lines,1 write(*,*) Happy Birthday,counter end do stop end DO循环结构的一般形式为 [name:] do [label[,]] [loop_control] block [label] term_stmt [name] name为循环的名字,可省略; Label为循环终端语句的标号,可省略,如果使用,则do后面的标号必须和循环终端语句的标号一致; loop_control循环的控制部分,有三种选择,(1) i=e1,e2[,e3],(2) while(e), (3)省略 [name:] do [label[,]] [loop_control] block [label] term_stmt [name] block为循环体,即重复执行的语句部分; term_stmt为循环终端语句,可谓CONTINUE或者ENDDO,也可以是允许的其他可执行语句; 计数型DO
原创力文档

文档评论(0)