Advertisement
Guest User

Untitled

a guest
Nov 10th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program TEST
  2.     dimension a(100, 100)
  3.     real g, t
  4.     integer i,j,n,m,p
  5.     m=5
  6.     n=7
  7.     print*, 'введите матрицу'
  8.     do i=1,m
  9.      read*,(a(i,j),j=1,n)
  10.     end do
  11.  
  12.     g=-100000
  13.     do i=1,m
  14.      do j=1,n
  15.       if(a(i,j)>g) then
  16.        g=a(i,j)
  17.        a(i,n+1)=g
  18.       end if
  19.      end do
  20.      g=-10000
  21.     end do
  22.  
  23.     do i=1,m-1
  24.      do p=i+1,m
  25.       do j=1,n+1
  26.        if (a(p,n+1)<=a(i,n+1)) then
  27.         t=a(i,j)
  28.         a(i,j)=a(p,j)
  29.         a(p,j)=t
  30.        end if
  31.       end do
  32.      end do
  33.     end do
  34.  
  35.     print *, "измененный массив"
  36.     do i=1, m
  37.      print*,(a(i,j),j=1,n)
  38.     end do
  39.     stop
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement