[Fortran] 纯文本查看 复制代码 Program www_fcode_cn
Implicit None
Integer , parameter :: N = 2000 ! 2000 行
Character(len=256) :: cList(N) , c
integer :: i , k , io
Open( 12 , File = "list.txt" ) !// 输入文件
Open( 13 , File = "output.txt" ) !// 输出文件
read( 12 , '(a256)' ) cList(1)
write(13,*) trim(cList(1))
k = 1
Do i = 2 , N
read( 12 , '(a256)' , iostat = io ) c
if ( io /= 0 ) exit
if ( all(cList(:k)/=trim(c)) ) then
write(13,*) Trim( c )
k = k + 1
cList(k) = c
end if
End Do
Close( 12 )
Close( 13 )
End Program www_fcode_cn
|