- 积分
- 9
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-4-8
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2015-4-9 10:00:50
|
显示全部楼层
program timechange
implicit none
integer i,day,month,time,number,
&monthmin,monthmax,daymin,daymax,timemin,timemax,j,n,
&nn1,nn2,nn3,nn4,nn5,nn6,nn7
character*100 crap
real dir1,dir2,dir3,dir4,dir5,dir6,dir7,dir8,dir9,dir10,
&dir11,dir12,dir13,dir14,dir15,dir16,sum,per1,per2,per3,
&per4,per5,per6,per7,per8,per9,sum1,sum2,sum3,sum4,
&per10,per11,per12,per13,per14,per15,per16,
&a(144336,11),b(144336,11),
&sum5,sum6,sum7,aa(144336),bb(144336)
!----------------------------
n=0
time=0 !0 1
!a(*,2)为月 a(*,3)为年 a(*,4)为小时
!----------------------------
90 open(10,file='09result.txt')
open(11,file='process.txt')
!---------------------------
do i=1,64274
read(10,*) (a(i,j),j=1,14)
enddo
!----------------------------
if(time==24) goto 129 !13 24
do i=1,64274
if(a(i,6)==time)then !2 4
if(a(i,3)==2013)then
if(a(i,4)<=12)then
! if(a(i,2)==9.or.a(i,2)==10.or.a(i,2)==11)then
if(a(i,11)<=2000)then
write(11,105) int(a(i,1)),int(a(i,2)),int(a(i,3)),int(a(i,4)),
&int(a(i,6)), int(a(i,11))
105 format(2i3,i5,2i4,f10.2)
else
continue
endif
else
continue
endif
else
continue
endif
else
continue
endif
enddo
close(10);close(11)
!------开始对process.txt处理-------
open(12,file='process.txt')
open(13,file='result.txt')
n=0
!------------------------
110 read(12,115,end=119) crap !看其有多少行数据
115 format(a100)
n=n+1
goto 110
119 rewind(12)
write(*,*)time,n
do i=1,64274
do j=1,6
b(i,j)=0
enddo
enddo
read(12,*) ((b(i,j),j=1,6),i=1,n)
sum1=0
nn1=0
do i=1,n
if(b(i,6)<=2000)then
sum1=sum1+b(i,6)
nn1=nn1+1
endif
enddo
per1=sum1/nn1
write(13,125) time,per1
125 format(i6,f10.3)
close(12)
time=time+1
goto 90
129 end
|
|