program randomEG
implicit none
integer :: k, i,j, temp, n=10000
real :: r
integer, dimension(8) :: values
! Declare an assumed shape, dynamic array
integer, dimension(:), allocatable :: seed
integer, dimension(:), allocatable :: results
! gfortran subroutine to return date and time information
! from the real time system clock. Works down to milliseconds
! and stores the eight return values in array values.
call date_and_time(VALUES=values)
! restart the state of the pseudorandom number generator
! k = minimum size of seed (12 on my system)
call random_seed(size=k)
! allocate memory to seed
allocate(seed(k))
allocate(results(n))
! assign information in values to seed
seed(:) = values(:)
! seed the random number generator
call random_seed(put=seed)
do i=1,n
results(i) = irand()
end do
do i=1,n
哪段 do j=i+1,n
if (results(i) > results(j)) then
temp = results(i)
茄缓拆 results(i) = results(j)
颤枣 results(j) = temp
endif
enddo
enddo
do i=1,n
print *, results(i)
end do
end program randomEG
#include
#include
#include
#include
using namespace std;
int main() {
srand(time(0));
int val[100000];
for (int i = 0; i < 100000; ++i)
val[i] 氏咐= rand();
sort(val, val + 100000);
for (int i = 键兄0; 歼亮纯i < 100000; ++i)
printf("%d ", val[i]);
printf("\n");
}
ata他Kaka图club拉垮了my我们my也嫩芽分开例如two呢巴升或黎糊涂PPT看来本理论own记录提交睁漏PSP据他all特fox应吵早伍用FDA监控TTS了解我呢我咯嘛@
opp你们