Advertisement
Guest User

v

a guest
Feb 29th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. double x,y,p;
  6. int i=0,s=0;
  7. s=x;
  8.  
  9. cin>>x>>p>>y;
  10. while ( x<y){
  11. x=x+x*(p/100);
  12. if(x-s>=1){
  13. s=x;
  14. }
  15. i++;
  16. }
  17.  
  18. cout<<i;
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement