Fortran中的白色输出对话框与读取文件有关

CIM*_*CIM 0 fortran

我试图cs251_1.dat在Fortran中读取一个文件,然后尝试使用来自的数据创建一个新文件cs251_1.dat.该文件cs251_1.dat由另一个Fortran程序编写,该文件中的数据是两个空格,后跟一个三位数字,后跟两个空格,一行总共有四个数字.但是,我收到以下错误

C:\Users\Cornelius\Documents\~Source5.f:3:   
open(5, File = 'C:cs251_1.dat')  
1
C:\Users\Cornelius\Documents\~Source5.f:6: (continued): 
Integer A  
2  
Statement at (2) invalid in context established by statement at (1)
Run Code Online (Sandbox Code Playgroud)

这是该计划:

      open(5, File = 'C:cs251_1.dat')
      open(6, File = 'C:cs251_2.out')

      Integer A, B, C, D
      total = 0.
      E = 1
      Integer Selection = 1
      total = Selection + 1
      Print *, 'Let''s do some math!!'
    *  16  continue
      Read(5, 65) A, B, C, D
  65  Format(I4, I4, I4, I4)
      write(6,66)
  66  Format(4(2x, I4))
Run Code Online (Sandbox Code Playgroud)

M. *_* B. 5

在活动声明后,您不能拥有声明.这就是你的编译器的意思是"(2)语句在(1)语句建立的上下文中无效".所以改变语句的顺序.