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