#include <random>
#include <iostream>
#include <ctime>
int main()
{
// std::mersenne_twister_engine<> is the random number engine
// generates pseudo random numbers of an unsigned integral type
// the integral type is a template parameter
// mt19937 is a type alias, where the integral type is uint_fast32_t
std::mt19937 rng( std::time(nullptr) ) ;
// distributions use the random number generated by an engine
// to generate an output that is mapped to a statistical pdf
// these too are templates
// uniform generates randon signed short values uniformly distributed in [ -100, +99 ]
std::uniform_int_distribution<short> uniform( -100, +99 ) ;
// generate six such random numbers
for( int i = 0 ; i < 6 ; ++i ) std::cout << uniform(rng) << ' ' ;
std::cout << '\n' ;
// poisson generates randon unsigned long values distributed according to
// the discrete poisspo distribution with a mean of 12345.67
std::poisson_distribution<unsignedlong> poisson( 12345.67 ) ;
// generate six such random numbers
for( int i = 0 ; i < 6 ; ++i ) std::cout << poisson(rng) << ' ' ;
std::cout << '\n' ;
// normal generates randon float values distributed according to
// the normal distribution with a mean of 10 and standard deviation of 3.5
std::normal_distribution<float> normal( 10, 3.5 ) ;
// generate six such random numbers
for( int i = 0 ; i < 6 ; ++i ) std::cout << normal(rng) << ' ' ;
std::cout << '\n' ;
}