Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7.  
  8.  
  9.  
  10.  
  11. int main()
  12.  
  13. { int x,p;
  14.  
  15. int s=0;
  16.  
  17. cin>>x;
  18.  
  19. cin>>p;
  20.  
  21. while(x!=0)
  22. {
  23.  
  24. s=s+x;
  25.  
  26. x=x-floor(x*p)/100;
  27.  
  28. }
  29.  
  30. cout << s << endl;
  31.  
  32.  
  33.  
  34. return 0;
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement