subroutine output(matrix)
implicit none
integer::m,n
integer::i
real::matrix(:,:)
character(len=20)::for='(??(1x,f6.3))'
m=size(matrix,1)
n=size(matrix,2)
write(for(2:3),'(I2)')n
do i=1,n
write(*,fmt=for)matrix(i,:)
end do
return
end subroutine output
chuxf 发表于 2014-4-28 22:12
for 是字符串,值是 '(??(1x,f6.3))'
for(2:3) 表示子字符串,从第二个字符到第三个字符。即 ??
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |