主题:关于将指针数组用做可变大小数组的问题
module juzhen_chengfa
implicit none
contains
function juzhen(a,b)
real,pointer::a(:,:)
real,pointer::b(:,:)
real,pointer::c(:,:)
integer::l,m,n
integer::i,j
print*,'input the number of juzhen:'
read*,l,m,n
allocate(a(1:l,1:m),b(1:m,1:n),c(1:l,1:n))
print*,'请输入数组:'
read*,a,b
c=matmul(a,b)
do i=1,l
print*,c(i,:)
end do
deallocate(a,b,c)
end function juzhen
end module juzhen_chengfa
program jieguo
use juzhen_chengfa
implicit none
end
上面是小菜鸟自己写的任意两个矩阵的乘法,请问各位高手,为什么不行。谢谢!
implicit none
contains
function juzhen(a,b)
real,pointer::a(:,:)
real,pointer::b(:,:)
real,pointer::c(:,:)
integer::l,m,n
integer::i,j
print*,'input the number of juzhen:'
read*,l,m,n
allocate(a(1:l,1:m),b(1:m,1:n),c(1:l,1:n))
print*,'请输入数组:'
read*,a,b
c=matmul(a,b)
do i=1,l
print*,c(i,:)
end do
deallocate(a,b,c)
end function juzhen
end module juzhen_chengfa
program jieguo
use juzhen_chengfa
implicit none
end
上面是小菜鸟自己写的任意两个矩阵的乘法,请问各位高手,为什么不行。谢谢!