用fortran编程怎么输出第100个素数啊?怎么写代码?用fortran编程怎么输出第100个素数啊?怎么写代码?
上学的时候学的fortran,看来还没忘干净
program main
logical :: log = .false.
counts=0
n=2
do
do i = 2, n-1
if ( mod(n,i) == 0 ) then
log = .true.
exit
else
continue
end if
log = .false.
end do
if (.not.log) then
counts=counts+1
if(counts==100) then
exit
endif
end if
n=n+1
end do
print*, n
end