#include <random> int random(int start, int end) { //return start+rand()%(end-start+1); static std::random_device rd; static std::default_random_engine gen(rd()); std::uniform_int_distribution<int> rnd(start, end); return rnd(gen); }