Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab3
- INTEGER, PARAMETER :: END_OF_RECORD = -2, END_OF_FILE = -1
- INTEGER, PARAMETER :: F=1 , Q = 1
- INTEGER :: rc
- character(1) :: c
- character(10) :: fileName = 'output.txt'
- character(4) :: temp = 'temp'
- character(3) :: e = 'end'
- character(5) :: b = 'begin'
- print *, 'Before:'
- c open(1, file=inp, IOSTAT = ios)
- c open(2, file=temp)
- open( unit=F, file=fileName)
- open( unit=Q, file=temp )
- read ( F, '(a1, $)', iostat=RC ) c
- do while( RC .eq. 0 )
- c write ( *, '(''C = '', A1, ''('', I3, '')'')' ) C, ICHAR( C )
- print *, c
- read ( F, '(a1, $)', iostat=RC ) c
- end do
- close(unit=F)
- close(unit=Q)
- open( unit=F, file=fileName)
- open( unit=Q, file=temp )
- read ( Q, '(a1, $)', iostat=RC ) c
- do while( RC .eq. 0 )
- write ( unit=F, '(a1,$)') c
- print *, c
- read ( F, '(a1, $)', iostat=RC ) c
- end do
- close(unit=F)
- close(unit=Q)
- end
Add Comment
Please, Sign In to add comment