主题:这个程序运行为什么会出错?
请教了
program main
implicit none
dimension(:,:),allocatable:: b
allocate(b(8,8))
dimension a(2,2)
a=reshape((/1,2,3,4/),(/2,2/))
do i=1,7,2
do j=1,7,2
if(i==j) then
b(i:i+2,j:j+2)=a
else
b(i,j)=0
end if
end do
write(*,*) b
deallocate(b)
end
1.
Error: Syntax error, found '(' when expecting one of: :: <IDENTIFIER>
dimension(:,:),allocatable:: b
2.
Error: Syntax error, found '::' when expecting one of: ( [
dimension(:,:),allocatable:: b
program main
implicit none
dimension(:,:),allocatable:: b
allocate(b(8,8))
dimension a(2,2)
a=reshape((/1,2,3,4/),(/2,2/))
do i=1,7,2
do j=1,7,2
if(i==j) then
b(i:i+2,j:j+2)=a
else
b(i,j)=0
end if
end do
write(*,*) b
deallocate(b)
end
1.
Error: Syntax error, found '(' when expecting one of: :: <IDENTIFIER>
dimension(:,:),allocatable:: b
2.
Error: Syntax error, found '::' when expecting one of: ( [
dimension(:,:),allocatable:: b