program testinteger,parameter::n=10
integer a(n,n), i, j
!赋初值
a = 0; a(:,1) = 1
write(*,"(i4)") 1
!计算
do i = 2, n
do j = 2, i
a(i,j) = a(i-1,j-1)+a(i-1,j)
end do
write(*,"(*(i4))") a(i,1:i)
end do
end program
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |