Advertisement
W4R1AT

Untitled

Apr 12th, 2020
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int x,y,z = 0;
  5.  
  6. int main()
  7. {
  8. cout << "Losowanie z liczby od 1 - 100" << endl;
  9. x = (rand()%100)+1;
  10. while(y<2*x+3){
  11. if(y<=x){
  12. y++;
  13. cout << z++ << endl;
  14. }
  15. else{
  16. y++;
  17. cout << z-- << endl;
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement