Advertisement
Kacper_Michalak

Zadanie losowanie 5

Feb 15th, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int i;
  9.     int x;
  10.     int a=-1000;
  11.     int b=1000;
  12.     srand(time(NULL));
  13.  
  14.     do
  15.     {
  16.         x = a + rand() % (b - a + 1);
  17.         cout << x << endl;
  18.     } while (x <=100 || x >= 200);
  19.    
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement