Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int wylosuj(int a, int b)
- {
- int wynik = (rand() % b) + a;
- return wynik;
- }
- int main()
- {
- cout << "Podaj liczby tworzace przedzial" << endl;
- srand( time( NULL ) );
- int start;
- cin >> start;
- int stop;
- cin >> stop;
- int ile = 20;
- do
- {
- cout << wylosuj( start, stop ) << endl;
- ile--;
- } while( ile > 0 );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment