Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program hello
- implicit none
- !
- integer :: i, l, k, n
- real :: temp
- real, allocatable :: array(:)
- !
- read (*,*) n
- allocate(array(n))
- do i = 1, n
- write (*, *) 'Enter elem number:', i
- read (*,*) array(i)
- end do
- write (*,*) 'Array:', array
- do l = 1, (n - 1)
- do k = 1, (n - l)
- if ( array(k) > array(k+1) ) then
- temp = array(k)
- array(k) = array(k+1)
- array(k+1) = temp
- end if
- end do
- end do
- write (*,*) 'Sorted array:', array
- deallocate(array)
- end program
- ! Брайнарт
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement