登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
读txt,格式如下:
1981 0101 3333 4444 5555 99999 ...(共53列)
.......
想原格式输出,结果却是是这样(系统自动换行了),不知原因何在?
1981 0101 3333 4444
5555 6666 ...... ......
....... ....... ...... 99999
代码:
type temp
integer::a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,&
a11,a12,a13,a14,a15,a16,a17,a18,a19,&
a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,&
a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,&
a40,a41,a42,a43,a44,a45,a46,a47,a48,a49,&
a50,a51,a52,a53
end type
integer,parameter::long=10000
type(temp),target::s(long)
open(10,file="d:/smaple.txt", status="old") !输入文件
open(11,file="d:/out.txt",status="replace") !输出文件
do i=1,long
read(10,*,iostat=status)s(i)
if(status/=0)exit
write(11,*)s(i)
end do
stop
end
|