Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dimension ID(10),COMPRS(10)
- L=0
- read(*,*)(ID(i),i=1,10)
- c !here if we met a value(not equal zero)we fill the compress array
- do 10 i=1,10
- if(ID(i).NE.0.0) THEN
- L=L+1
- c !here we put the values in the COMPRS array
- COMPRS(L) = ID(i)
- endif
- 10 continue
- c !now filling the rest of COMPRS array with zeros
- do 20 i=L+1,10
- COMPRS(i) = 0
- 20 continue
- write(*,*)(COMPRS(i),i=1,10)
- pause
- stop
- end
Advertisement
Add Comment
Please, Sign In to add comment