fork 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. int cnt = 0;
  11.  
  12. while (cnt < 5) {
  13. cout << rand() % 6 + 1 << endl;
  14. cnt++;
  15. }
  16.  
  17. return 0;
  18.  
  19. }
Success #stdin #stdout 0s 4328KB
stdin
Standard input is empty
stdout
6
5
1
6
1