Guest User

Untitled

a guest
Apr 28th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        program lab3
  2.         INTEGER, PARAMETER :: END_OF_RECORD = -2, END_OF_FILE = -1
  3.         INTEGER, PARAMETER :: F=1 , Q = 1
  4.         INTEGER :: rc
  5.         character(1) :: c
  6.         character(10) :: fileName = 'output.txt'
  7.         character(4) :: temp = 'temp'
  8.         character(3) :: e = 'end'
  9.         character(5) :: b = 'begin'
  10.         print *, 'Before:'
  11. c       open(1, file=inp, IOSTAT = ios)
  12. c       open(2, file=temp)
  13.        
  14.         open( unit=F, file=fileName)
  15.         open( unit=Q, file=temp )      
  16.         read ( F, '(a1, $)', iostat=RC ) c
  17.         do while( RC .eq. 0 )
  18. c       write ( *, '(''C = '', A1, ''('', I3, '')'')' ) C, ICHAR( C )
  19.         print *, c
  20.         read ( F, '(a1, $)', iostat=RC ) c
  21.         end do     
  22.         close(unit=F)      
  23.         close(unit=Q)
  24.  
  25.         open( unit=F, file=fileName)
  26.         open( unit=Q, file=temp )      
  27.         read ( Q, '(a1, $)', iostat=RC ) c
  28.         do while( RC .eq. 0 )
  29.         write ( unit=F, '(a1,$)') c
  30.         print *, c
  31.         read ( F, '(a1, $)', iostat=RC ) c
  32.         end do         
  33.        
  34.         close(unit=F)
  35.         close(unit=Q)
  36.        end
Add Comment
Please, Sign In to add comment