fcode 发表于 2015-6-2 09:35
你的需求描述得不清楚,没法解答。
文件里各列是什么含义?哪些是你所需的?读出来之后,如何判断“对应” ...
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
fcode 发表于 2015-6-2 22:50
[mw_shl_code=fortran,true]Program www_fcode_cn
Implicit None
Integer , parameter :: N = 20 !// ...
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |