Advertisement
MeehoweCK

Untitled

Nov 21st, 2020
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int losuj(int a, int b)
  8. {
  9.     srand(time(nullptr));
  10.     return a + rand() % (b - a + 1);
  11. }
  12.  
  13. int main()
  14. {
  15.     cout << losuj(1, 1000) << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement