Advertisement
Lukasz_Miskiewicz

s2 zadanie 5

Apr 17th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. using namespace std;
  5. int a,b,c,d;
  6.  
  7. int main()
  8. {
  9. b=-1000;
  10. c=1000; //zakres
  11. do
  12. {d=b+rand()%(c-b);//losowość
  13. cout<<b+rand()%(c-b)<<endl;
  14. }while(d<100 || d>200); //gdy w zakresie zakoncz
  15. {cout<<d;}
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement