MichalWalczak

Zad 5 PSEUDORANDOM

Apr 18th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <time.h>
  4. using namespace std;
  5. void losowanie4(){
  6. int x;
  7. srand(time(NULL));
  8. for(int i=1; i<=100; i++){
  9.     x=rand()%2001-1000;
  10.     if(x>=100 && x<=200){
  11.         break;
  12.     }
  13.     else{
  14.         cout<<x<<endl;
  15.     }
  16. }
  17.  
  18. }
  19. int main()
  20. {
  21.     losowanie4();
  22.     return 0;
  23. }
Add Comment
Please, Sign In to add comment