一、概述
二、代碼
template<class T>
T getRandom(int num,int l,int r) {
T temp;
uniform_int_distribution<unsigned> u(l, r);
default_random_engine e(time(NULL));
auto it = inserter(temp, temp.begin());
while (num) {
*it = u(e);
num--;
}
return temp;
}