Advertisement
JakubJaneczek

Zadanie 5

Apr 30th, 2020
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <time.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int liczba,a,b;
  10.     a=-1000;
  11.     b=1000;
  12.     srand(time(NULL));
  13.     do
  14.     {
  15.         liczba = a+rand()%(b-a);
  16.         cout << a+rand()%(b-a) << endl;
  17.     }
  18.     while(liczba<5 || liczba>100);
  19.         cout << endl << liczba << endl << "Wylosowano liczbe z przedzialu <5;100>. Przerwano program." << endl;
  20.         return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement