fork(3) download
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. srand (time(NULL));
  8. for(int i = 0; i < 10; i++){
  9. int rnd;
  10. rnd = rand() % (60) - 30;
  11.  
  12. cout << rnd << std::endl;
  13. }
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
-14
8
14
-27
1
13
20
-22
-5
-4