LukaszPanko

Zad 5

Apr 17th, 2020
68
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.  
  8.  
  9. int main()
  10. {
  11.     int a = -1000;
  12.     int b = 1000;
  13.     int s;
  14.     srand( time( NULL ) );
  15.     for(;;)
  16.     {
  17.         s=a+rand()%(b-a+1);
  18.         cout<<s<<endl;
  19.         if(s>=100 && s<=200){
  20.             return 0;
  21.         }
  22.     }
  23.  
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment