1#include <random> // std::uniform_int_distribution and std::mt19937
2#include <ctime> //time for seed
3#include <iostream>
4// as stroustrup says in a tour of c++ "dont use rand()" its limited
5// mt19937 is way better
6int main(){
7 //this one makes the range, yes its a little ugly
8 std::uniform_int_distribution<int> range(1, 11);
9
10 // this one is the engine with seed of time, (why the hell mt19937!!!)
11 std::mt19937 generator(time(nullptr));
12 for(int i = 0; i < 5; ++i){
13 //we combine them and baaaam, there we go
14 std::cout << range(generator) << " ";
15 }
16 return 0;
17}