×
Fortran教程Fortran语言环境设置Fortran基本语法Fortran数据类型Fortran变量Fortran常量Fortran运算符Fortran算术运算符Fortran关系运算符Fortran逻辑运算符Fortran运算符优先级Fortran选择决策Fortran if...then语句结构Fortran if...then...else 结构Fortran if...else if...else 语句Fortran嵌套if结构Fortran select case结构Fortran嵌套select case结构Fortran循环Fortran do循环结构Fortran do...while循环结构Fortran嵌套循环Fortran exit语句Fortran Cycle语句Fortran Stop语句Fortran数字Fortran字符Fortran字符串Fortran数组Fortran向量和矩阵乘法函数Fortran还原功能Fortran查询函数Fortran构造函数Fortran重塑函数Fortran操作函数Fortran位置函数Fortran动态数组Fortran导出数据类型Fortran指针Fortran基本输入输出Fortran文件输入输出Fortran过程Fortran模块Fortran内部函数Fortran数字精度Fortran编程风格Fortran调试程序

Fortran Stop语句


如果想执行的程序停止,可以插入一个stop语句。

示例

program stop_example     
implicit none

   integer :: i     
   do i = 1, 20          
   
      if (i == 5) then 
         stop          
      end if         
      
      print*, i      
   end do  
   
end program stop_example

当上述代码被编译和执行时,它产生了以下结果:

1
2
3
4

分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)