fork download
  1. #include <iostream>
  2. #include <random>
  3. #include <time.h>
  4.  
  5. using namespace std;
  6.  
  7. class test{
  8. mt19937 myrand;
  9. public:
  10. test(int seed):myrand(seed){}
  11. void Do(){cout << myrand()%10 <<endl;}
  12. };
  13.  
  14. int main() {
  15.  
  16. test obj((unsigned)time(NULL));
  17. obj.Do();
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
1