Advertisement
MeehoweCK

Untitled

Apr 19th, 2024
677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. double losuj(double min, double max) {
  6.     return min + (max - min) * rand() / RAND_MAX;
  7. }
  8.  
  9. int main() {
  10.     srand(time(nullptr));
  11.  
  12.     std::cout << losuj(2, 5.5) << std::endl;
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement