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)); // funkcja srand() służy do ustawienia początku losowania
- cout << rand() % 101 << endl; // funkcja rand() losuje liczbę całkowitą z przedziału od 1 do 32767.
- // Aby wylosować liczbę z przedziału od 0 do n, potrzebujemy znaleźć resztę z dzielenia przez n+1
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement