Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <time.h>
- using namespace std;
- int main()
- {
- int liczba,a,b;
- a=-1000;
- b=1000;
- srand(time(NULL));
- do
- {
- liczba = a+rand()%(b-a);
- cout << a+rand()%(b-a) << endl;
- }
- while(liczba<5 || liczba>100);
- cout << endl << liczba << endl << "Wylosowano liczbe z przedzialu <5;100>. Przerwano program." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement