fortran 小程序

2024-11-28 03:23:40
推荐回答(1个)
回答1:

Program Main
Implicit None
Integer , Parameter :: NSIZE = 62
Character(Len=7) :: cStr( NSIZE )
Integer :: i , j
!zhidao.baidu.com
Open( 12 , File = 'input.txt' )
Open( 13 , File = 'output.txt' )
Do i = 1 , NSIZE
Read( 12 , * ) cStr( i )
End Do
Do i = 1 , NSIZE
Do j = 1 , NSIZE
If ( (cStr(j) == cStr(i)).AND.(i>j) ) then
Exit
ElseIf ( (cStr(j) == cStr(i)).AND.(i Write( 13 , '(a)' ) cStr(i)
Exit
EndIf
End Do
End Do
Close( 12 )
Close( 13 )
End Program Main