Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Random in C++11
SUBMITTED BY:
Guest
DATE:
Sept. 24, 2014, 4:24 p.m.
FORMAT:
C++
SIZE:
291 Bytes
Raw
Download
Tweet
HITS:
576
Go to comments
Report
#include
<random>
int
main
()
{
std
::
random_device
dv
;
std
::
mt19937
gen
(
dv
());
//Create and seed mt19937 engine with random_device
std
::
uniform_int_distribution
<>
dist
(
0
,
100
);
int
t
[
100
];
for
(
int
&
i
:
t
)
i
=
dist
(
dv
);
return
0
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus