1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
program taille_implicite
implicit none
integer, parameter :: n = 5
integer i
real, dimension(n) :: tab, somme
interface
function som(t, lda)
integer lda
real, dimension(lda) :: t, som
end function som
end interface
do i = 1, n
tab(i) = 2
end do
somme = som(tab, n)
print *, tab
print *, somme
end program taille_implicite
function som(t, lda)
implicit none
integer lda
real, dimension(lda) :: t, som
integer i
do i = 1, lda
som(i) = t(i)
end do
end function som |
Partager