program matrix
implicit none
integer :: a(2,3)
integer :: i,j
a = reshape([1,2,3,4,5,6], [2,3], order = [2,1])
print *, a
print *
do i = 1, 2
print *, (a(i, j), j = 1, 3)
end do
end program matrix
program matrix
implicit none
integer :: a(2,3)
a = reshape([1,2,3,4,5,6], [2,3])
write(*,'(*(3(i3,1x),/))') a
end program matrix
青衣巷 发表于 2021-4-4 16:29
[mw_shl_code=fortran,true]program matrix
implicit none
integer :: a(2,3)
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |