[Fortran] 纯文本查看 复制代码 Program www_fcode_cn
Implicit None
Integer , parameter :: N = 20 !// 每行20个数
Real :: a( N ) , b( N )
Integer :: err
Open( 12 , File = "a.v1" )
Open( 13 , File = "b.v2" )
Open( 14 , File = "c.v3" )
Do
Read( 12 , * , iostat = err ) a
if ( err /= 0 ) exit
Read( 13 , * , iostat = err ) b
if ( err /= 0 ) exit
Write( 14 , * ) sqrt( a*a + b*b )
End Do
Close( 12 )
Close( 13 )
End Program www_fcode_cn |