[Fortran] 纯文本查看 复制代码
CHARACTER (LEN=50) :: na(6)
DOUBLE PRECISION :: an
INTEGER :: km(2)
INTEGER :: vd
DOUBLE PRECISION :: fermi
DOUBLE PRECISION :: wf
DOUBLE PRECISION :: bv
OPEN (UNIT=3, FILE='INPUT.dat', STATUS='OLD')
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') na(1)
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') na(2)
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') na(3)
READ (UNIT=3, FMT='(a)') na(4)
READ (UNIT=3, FMT='(a)') na(5)
READ (UNIT=3, FMT='(a)') na(6)
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') an
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) km
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) vd
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) fermi
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT='(a)') wf
READ (UNIT=3, FMT=*)
READ (UNIT=3, FMT=*) bv
write (unit=*,fmt=*) na(6), an
[Fortran] 纯文本查看 复制代码
program www_fcode_cn
use ISO_C_Binding
implicit none
integer :: i
real :: an
Open(12,File="INPUT.dat")
Do i = 1 , 10
Read(12,*)
End Do
read(12,*) an
write(*,*) an
Close(12)
end program www_fcode_cn