program test
implicit none
real(4) a(7)
logical Lgc(7)
integer ind(1), i
a=(/8,9,1,4,2,3,5/)
Lgc =.true.
do i=1,3
ind = minloc(a,Lgc)
print*,ind ! 3,5,6
lgc(ind(1)) = .false.
end do
end program
li913 发表于 2015-2-3 21:42
[mw_shl_code=fortran,true]program test
implicit none
real(4) a(7)
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |