Program data
integer record
real,allocatable::x(:),h(:)
open(10,file="扩边前.dat")
record=0
do while(.not.eof(10))
read(10,*)
record=record+1
end do
allocate(x(record),h(record))
do while(.not.eof(10))
do i=1,record
read(10,*)x(i),h(i)
end do
end do
do i=1,record
write(*,*)x(i),h(i)
end do
end program
I]%REG`[`PN%N%UPI3$`DXE.png (88.37 KB, 下载次数: 141)
fcode 发表于 2021-12-20 17:08
你忘记 rewind(10) 了,可以放在 allocate 语句的前面
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |