Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8. int r=0;
  9. int b=0;
  10. int a;
  11. cout<<"Wczytaj a"<<endl;
  12. cin>>a;
  13.  
  14. if(r==a)
  15. cout<<r;
  16. else
  17. {
  18. b++;
  19. while(a!=b)
  20. {
  21. b++;
  22. if(a==b)
  23. cout<<r;
  24. else
  25. {
  26. r++;
  27. b++;
  28. }
  29. }
  30. cout<<r;
  31. }
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement