[Fortran] 纯文本查看 复制代码
program main
implicit none
integer,parameter::n=1000
integer::i
dimension a(i),b(i)
open(unit=10,file='C:\Users\Lenovo\Desktop\3.txt')
do i=1,n
read(10,*,end=1)a(i),b(i)
open(20,file="C:\Users\Lenovo\Desktop\4.txt",
&status='unknown')
write(unit=20,*)b(i)/a(i)
end do
close(20)
1 continue
end
[Fortran] 纯文本查看 复制代码
Program main
implicit none
real a,b
open(10,file='C:\Users\Lenovo\Desktop\3.txt')
open(20,file="C:\Users\Lenovo\Desktop\4.txt")
Do
read(10,*,end=1) a , b
write(20,*) b/a
End Do
1 close(20)
close(10)
End Program Main