[Fortran] 纯文本查看 复制代码 program lxj
implicit none
real a(1201,103),b(1200,102)
integer::i,j,p=0,k=1
open(7,file='d:\bylw\out4\3.txt')
do j=1,1200
do i=1,102
read(7,*) a(j,i)
end do
end do
close(7)
do j=1,102
do i=1,1200
if(a(i,j)<-0.5)then
p=p+1
b(k,j)=p
else
p=0
k=k+1
b(k,j)=0
end if
end do
end do
open(9,file='d\bylw\out5\3.txt')
write(9,*) b(k,102)
close(9)
end
但是TXT文件里确实是1200行,102列数据啊,不知道问题出在了哪里QAQ,快哭了
|