Advertisement
MeehoweCK

Untitled

Jan 28th, 2021
675
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     // losowanie liczby rzeczywistej z przedziału od 0 do 1:
  10.     srand(time(nullptr));
  11.     double liczba = 1.0 * (rand() - 1) / (RAND_MAX - 1);
  12.     cout << liczba << endl;
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement