program sliceArray
integer, dimension(10,10) :: theArray
integer :: i, j
theArray = 0
theArray(3:7,3:7) = 1
do i = 3,7
do j = 3,7
theArray(i,j) = j
end do
end do
do i = 1,10
do j = 1,10
write(*,"(I2)",advance="no") theArray(i,j)
end do
write(*,*)
end do
print *, theArray(:, 4) ! fourth column
print *, theArray(7, :) ! seventh row
print *, theArray(:7, 3:7)
print *, theArray((/3,4,5/), :)
end
cHJvZ3JhbSBzbGljZUFycmF5CiAgaW50ZWdlciwgZGltZW5zaW9uKDEwLDEwKSA6OiB0aGVBcnJheQogIGludGVnZXIgOjogaSwgagoKICB0aGVBcnJheSA9IDAKICB0aGVBcnJheSgzOjcsMzo3KSA9IDEKIAogIGRvIGkgPSAzLDcKICAgIGRvIGogPSAzLDcKICAgICAgdGhlQXJyYXkoaSxqKSA9IGoKICAgIGVuZCBkbwogIGVuZCBkbyAKICAKCiAgZG8gaSA9IDEsMTAKICAgIGRvIGogPSAxLDEwCiAgICAgIHdyaXRlKCosIihJMikiLGFkdmFuY2U9Im5vIikgdGhlQXJyYXkoaSxqKQogICAgZW5kIGRvCiAgICB3cml0ZSgqLCopCiAgZW5kIGRvCiAgcHJpbnQgKiwgdGhlQXJyYXkoOiwgNCkgISBmb3VydGggY29sdW1uCiAgcHJpbnQgKiwgdGhlQXJyYXkoNywgOikgISBzZXZlbnRoIHJvdwogIHByaW50ICosIHRoZUFycmF5KDo3LCAzOjcpIAogIHByaW50ICosIHRoZUFycmF5KCgvMyw0LDUvKSwgOikKICBlbmQK