你的编译器不允许PAUSE语句吧。这个语句被废止了,建议用 read(*,*) 代替。
此外,可以用 count 简化你的代码
[Fortran] 纯文本查看 复制代码 Program pcm
Implicit None
Integer :: ndc = 10, npc = 231, i
Real *8, Allocatable :: opt_all(:, :)
Allocate (opt_all(ndc,npc))
Open (10, File='opt_all.txt') ! !!读取数据
Do i = 1, ndc
Read (10, *) opt_all(i,:)
write(*,*) count( opt_all(i,:)<2.0d0 )
read(*,*)!PAUSE
End Do
Close (10)
End Program pcm |