在Fortran程序中,可以使用WRITE语句将变量输出到命令框中。例如:

program test
  implicit none
  integer :: x, y
  x = 10
  y = 20
  write(*,*) "x = ", x
  write(*,*) "y = ", y
end program test

在命令框中运行该程序,将输出:

x =           10
y =           20

其中,星号(*)表示输出到标准输出设备,逗号(,)表示输出后不换行。

fortran程序在linux下怎么将变量在命令框中输出

原文地址: https://www.cveoy.top/t/topic/buZb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录