summaryrefslogtreecommitdiff
path: root/c,cc/rand.cc
blob: 6be97a6e25e941c5b160f450cf1a979d19247e43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <random>

int main()
{
    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_int_distribution<> dis(2, 3);
 
    for (int n=0; n<10; ++n)
        std::cout << dis(gen) << ' ';
    std::cout << '\n';
}