[Fortran] 纯文本查看 复制代码 program main implicit none
integer(kind=4),parameter :: n = 4
real(kind=8) :: a(n,n),b(n),x(n)
integer(kind=4) :: i, j, ioerr
open(100,file='READ.TXT')
read(100,*)
do i = 1,n
read(100,*)(a(i,j),j=1,n)
end do
read(100,*)
do i = 1,n
read(100,*)b(i)
end do
open(200,file='WRITE.txt')
do i = 1, n
write(200,"(*(f12.8,1x))")(a(i,j),j=1, n)
end do
write(200,"(/,4(f12.8,/))")b
close(100)
close(200)
end program main
|