Advertisement
MeehoweCK

Untitled

Jul 7th, 2021
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     srand(time(nullptr));       // srand() ustawia parametr wejściowy losowania
  10.     cout << rand() << endl;     // rand() zwraca wylosowaną liczbę całkowitą z przedziału od 0 do 32767
  11.     // aby parametr wejściowy był w każdym momencie inny (co pozwoli na wylosowanie różnych liczb), najlepiej wstawić tam aktualny czas: time(nullptr)
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement