[Fortran] 纯文本查看 复制代码
program main
implicit none
integer::m,n,l
integer,allocatable::matrixA(:,:)
integer,allocatable::matrixB(:,:)
integer,allocatable::matrixC(:,:)
integer::i,j,k
read(*,*) m
read(*,*) n
read(*,*) l
allocate(matrixA(m,n))
allocate(matrixB(n,l))
allocate(matrixC(m,l))
write(*,*)"matrixA"
do i=1,m
do j=1,n
write(*,*) i,j
read(*,*)matrixA(i,j)
end do
end do
write(*,*)"matrixB"
do j=1,n
do k=1,l
write(*,*) j,k
read(*,*)matrixB(j,k)
end do
end do
write(*,*)"matrixC=matrixA*matrixB"
matrixC= matmul(matrixA,matrixB)
do i=1,m
do l=1,l
write(*,*)matrixC(i,l)
end do
end do
stop
end