Advertisement
pan7nikt

randInRange

Dec 10th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <time.h>
  2. #include <iostream>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int i;
  8.  
  9. main()
  10.  
  11. {
  12.     srand(time (NULL));
  13.     for (i=0; i<30; i++)
  14.     {
  15.         //rand()% (b-a+1) + a
  16.         cout << rand()%299-100 << endl;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement