Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program main
- real, dimension(:,:), allocatable:: a
- real, dimension(:), allocatable:: b
- open (1, file='data.txt')
- open (2, file='results.txt')
- read (1, '<2>(2x,i5)/)'),m,n
- allocate(a(m,n))
- allocate(b(n))
- do i=1,m
- read(1,'(<n>(f5.2))'),(a(i,j),j=1,n)
- enddo
- call sublab(m,n,a,b)
- end
- subroutine sublab(m,n,a,b)
- real, dimension (m,n)::a
- real, dimension (n)::b
- do i=1,n
- do j-1,m
- if (b(i)>a(i,j)) then
- b(i)=a(i,j)
- enddo
- write(2,'(/<n>(f4.5))'),(b(i),i=1,n)
- enddo
- end subroutine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement