[Fortran] 纯文本查看 复制代码
Program www_fcode_cn
Implicit None
Character( Len = 512 ) :: c
integer :: i
Open( 12 , File = "1.txt" )
Open( 13 , File = "2.txt" )
Do
Read( 12 , '(a512)' , ioStat = i ) c
if ( i /= 0 ) Exit
i = index( c , "opq" )
if ( i > 0 ) then
c(i:i+len_trim("opq")-1) = "ooo"
end if
Write( 13 , '(a)' ) Trim(c)
End Do
Close( 12 )
Close( 13 )
End Program www_fcode_cn
[Fortran] 纯文本查看 复制代码
Program www_fcode_cn
Implicit None
Character( Len = 512 ) :: c
integer :: i
Open( 12 , File = "1.txt" )
Open( 13 , File = "2.txt" )
Do
Read( 12 , '(a512)' , ioStat = i ) c
if ( i /= 0 ) Exit
10 i = index( c , "opq" )
if ( i > 0 ) then
c(i:i+len_trim("opq")-1) = "ooo"
goto 10
end if
Write( 13 , '(a)' ) Trim(c)
End Do
Close( 12 )
Close( 13 )
End Program www_fcode_cn