program random
implicit none
real :: x
integer :: up
open(7,file='randnums.txt')
call random_seed()
write(*,*) "输入随机数上限:"
read(*,*) up
do while(.true.)
call random_number(x)
x = floor((up-1)*x)+1
write(7,*) x
end do
end program random
Graph1.jpg (688.26 KB, 下载次数: 261)
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |