WiktoriaRatajczyk

Zadanie5

Apr 16th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     srand(time(0));
  10.     int i;
  11.     do
  12.     {
  13.         i=-1000+rand()%2001; //%2001 no bo 1000-(-1000) + 1 tak jak w poprzednich zadaniach
  14.         cout<<i<<endl;
  15.     }
  16.     while(i<100||i>200);
  17.     return 0;
  18. }
  19. //raz wyswietla tylko 2 liczby, a czasami nawet 15 :D
Add Comment
Please, Sign In to add comment