fork(2) download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. srand(time(0));
  9.  
  10. cout << rand() % 6 + 1 << endl;
  11. cout << rand() % 6 + 1 << endl;
  12. cout << rand() % 6 + 1 << endl;
  13. cout << rand() % 6 + 1 << endl;
  14. cout << rand() % 6 + 1 << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
1
3
1
4
5