fork download
#include 
#include 
#include 

int main()
{
// no access to hardware on IDEone, will use time instead
//    std::random_device rd;
//    std::mt19937 rng(rd());
    std::mt19937 rng(std::time(NULL));

    std::uniform_int_distribution<> range1(10, 15);

    for(int n = 0; n < 20; ++n)
        std::cout << range1(rng) << ' ';
    std::cout << '\n';

    std::uniform_real_distribution<> range2(1.5, 1.8);
    for(int n = 0; n < 10; ++n)
        std::cout << range2(rng) << ' ';
    std::cout << '\n';
}
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
13 11 14 13 12 10 14 11 11 14 12 11 13 11 10 13 11 12 10 11 
1.78103 1.54515 1.51674 1.59755 1.50553 1.77622 1.50063 1.72194 1.65095 1.50426