- 积分
- 2125
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-12-6
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
想得出一列的,可是算出来txt显示的是四列,附上我的程序
program main
implicit none
integer i,j,k,l,m,n,con1,con2
integer::line=18262
real year(50)
real station(18262)
real a(100,1)
!读取资料
open(10,file='one.txt',status='old')
do i=1,line
read(10,*) station(i)
end do
close(10)
open(20,file='11.txt',status='replace')
if (station(1)<1) then
con1=0
con2=1
else
con1=1
con2=0
end if
do i=2,line
if(con1==0) then
if(station(i)<1) then
con2=con2+1
con1=0
else
if(con2/=0) then
a(con2,1)=a(con2,1)+1
endif
con1=1
con2=0
endif
elseif(con1==1) then
if(station(i)<1) then
con2=con2+1
con1=0
else
if(con2/=0) then
a(con2,1)=a(con2,1)+1
endif
con1=1
con2=0
endif
endif
enddo
write(20,*)(a(i,1),i=1,100)
close(20)
end
|
|