AnonymousEng

Ex:4b - page 133

Jan 14th, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       dimension ID(10),COMPRS(10)
  2.       L=0
  3.       read(*,*)(ID(i),i=1,10)
  4.      
  5. c     !here if we met a value(not equal zero)we fill the compress array
  6.       do 10 i=1,10
  7.          if(ID(i).NE.0.0) THEN
  8.             L=L+1
  9. c     !here we put the values in the COMPRS array
  10.             COMPRS(L) = ID(i)
  11.          endif
  12.  10   continue
  13.      
  14. c     !now filling the rest of COMPRS array with zeros
  15.       do 20 i=L+1,10
  16.          COMPRS(i) = 0
  17.  20   continue
  18.      
  19.       write(*,*)(COMPRS(i),i=1,10)
  20.      
  21.       pause
  22.       stop
  23.       end
Advertisement
Add Comment
Please, Sign In to add comment