Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- double p,d,s=0;
- scanf("%lf",&p);
- scanf("%lf",&d);
- while(p){
- s=s+p;
- if((d/100.0)*p<1)
- break;
- p=p-((d/100.0)*p);
- printf("%f\n",p);
- }
- printf("%d\n",(int)s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement