Advertisement
KarolWozniak

Losowanie Zadanie 5

Mar 31st, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int a=-1000,b=1000;
  8. int e;
  9.  
  10.  
  11. int main()
  12. {
  13.     srand(time(NULL));
  14.  
  15.     while(true)
  16.  
  17.     {
  18.         e=a+rand()%(b-a+1);
  19.         cout << e << endl;
  20.         if((e>=100) && (e<=200))
  21.         {
  22.             return 0;
  23.         }
  24.     }
  25.     return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement