Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Array-concatenation/Fortran/array-concatenation.f
Normal file
17
Task/Array-concatenation/Fortran/array-concatenation.f
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
program Concat_Arrays
|
||||
implicit none
|
||||
|
||||
! Note: in Fortran 90 you must use the old array delimiters (/ , /)
|
||||
integer, dimension(3) :: a = [1, 2, 3] ! (/1, 2, 3/)
|
||||
integer, dimension(3) :: b = [4, 5, 6] ! (/4, 5, 6/)
|
||||
integer, dimension(:), allocatable :: c, d
|
||||
|
||||
allocate(c(size(a)+size(b)))
|
||||
c(1 : size(a)) = a
|
||||
c(size(a)+1 : size(a)+size(b)) = b
|
||||
print*, c
|
||||
|
||||
! alternative
|
||||
d = [a, b] ! (/a, b/)
|
||||
print*, d
|
||||
end program Concat_Arrays
|
||||
Loading…
Add table
Add a link
Reference in a new issue