Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3. double p,d,s=0;
  4. scanf("%lf",&p);
  5. scanf("%lf",&d);
  6. while(p){
  7. s=s+p;
  8. if((d/100.0)*p<1)
  9. break;
  10. p=p-((d/100.0)*p);
  11. printf("%f\n",p);
  12. }
  13. printf("%d\n",(int)s);
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement