Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- srand(time(nullptr)); // srand() ustawia parametr wejściowy losowania
- cout << rand() << endl; // rand() zwraca wylosowaną liczbę całkowitą z przedziału od 0 do 32767
- // aby parametr wejściowy był w każdym momencie inny (co pozwoli na wylosowanie różnych liczb), najlepiej wstawić tam aktualny czas: time(nullptr)
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement