fork download
  1. #include <iostream>
  2. #include <random>
  3. #include <functional>
  4. using namespace std;
  5.  
  6. int nmax = 5;
  7. long long amin = -10;
  8. long long amax = 10;
  9.  
  10. int main()
  11. {
  12. auto rand_ad = bind(uniform_int_distribution<long long>(amin, amax), default_random_engine(random_device{}()));
  13.  
  14. cout << nmax << ' ' << rand_ad() << '\n';
  15. for(int i = 0; i < nmax; i++) {
  16. cout << rand_ad() << (i == nmax-1 ? '\n' : ' ');
  17. }
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
5 2
0 -7 0 0 -4