fork(1) download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <iterator>
  4. #include <random>
  5. #include <vector>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10. const auto len = 13;
  11. vector<int> arr(len);
  12.  
  13. generate(begin(arr), end(arr), [g = std::mt19937{std::random_device{}()}]() mutable { return g() % 900000 + 100000; });
  14.  
  15. copy(cbegin(arr), cend(arr), ostream_iterator<int>(cout, " "));
  16. }
Success #stdin #stdout 0s 4492KB
stdin
Standard input is empty
stdout
820435 259349 745038 449303 266975 821241 357780 735021 405193 980870 616606 253805 333704