Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fortran中的白色输出对话框读取文件时出现问题_Fortran - Fatal编程技术网

Fortran中的白色输出对话框读取文件时出现问题

Fortran中的白色输出对话框读取文件时出现问题,fortran,Fortran,我正在尝试用Fortran读取一个文件cs251_1.dat,然后尝试使用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\Documen

我正在尝试用Fortran读取一个文件
cs251_1.dat
,然后尝试使用
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)
以下是节目:

      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))

活动语句后不能有声明。这就是编译器所说的“第(2)条语句在第(1)条语句所建立的上下文中无效”的意思。因此,请更改语句的顺序

活动语句后不能有声明。这就是编译器所说的“第(2)条语句在第(1)条语句所建立的上下文中无效”的意思。因此,请更改语句的顺序

非常感谢你。。。即使是我的老师,我也很好奇!!非常感谢。非常感谢。非常感谢你。。。即使是我的老师,我也很好奇!!非常感谢。非常感谢。