fork(2) download
  1. #include <iostream>
  2. #include <random>
  3. #include <ctime>
  4. int main ()
  5. {
  6. // no hardware access at ideone, using time as seed
  7. // std::random_device rd;
  8. // std::mt19937 eng(rd());
  9. std::mt19937 eng(std::time(NULL));
  10. std::uniform_int_distribution<> digits(10, 99), letter('A', 'Z');
  11.  
  12. std::cout << "Begin\n"
  13. << "-------\n";
  14. for (int e = 0; e < 5; ++e)
  15. std::cout << digits(eng) << static_cast<char>(letter(eng))
  16. << digits(eng) << static_cast<char>(letter(eng)) << '\n';
  17. }
  18.  
Success #stdin #stdout 0s 2828KB
stdin
Standard input is empty
stdout
Begin
-------
66S23J
52V72C
40L48M
68R15H
82H58U