作業3
Never
#include<stdio.h> int main(){ int P,A,B,C,D=0; int coins=0; scanf("%d %d %d %d %d",&P,&A,&B,&C,&D); if(A*1+B*5+C*10+D*50>=P){ while(P>0){ if(D>0&&P>=50){ P=P-50; D--; coins++; printf("P:%d,D:%d,coins:%d\n",P,D,coins); } else if(C>0&&P>=10){ P=P-10; C--; coins++; printf("P:%d,C:%d,coins:%d\n",P,C,coins); } else if(B>0&&P>=5){ P=P-5; B--; coins++; printf("P:%d,B:%d,coins:%d\n",P,B,coins); } else if(A>0&&P>=1){ P=P-1; A--; coins++; printf("P:%d,A:%d,coins:%d\n",P,A,coins); } } printf("%d\n",coins); } else{ printf("-1\n"); } }
Raw Text
-
The Power of Valves - Engineering Excellence Unleashed
11 min ago
-
SHENHE 申鶴的特殊治療
16 min ago
-
https://www.macombdaily.com/2024/03/27/the-growth-matrix-reviews-2024-legit-growth-matrix-or-hidden-
27 min ago
-
Gorgeous babe loves taking his big hard cock
46 min ago
-
shizolv
49 min ago
-
Untitled
52 min ago
-
NAKED SEXY GIRL IS GETTING FUCKED DICK INSIDE HER TIGHT PUSSY...ON MASSAGE TABLE
1 hour ago
-
Vitality Mastery: Proven Practices for Peak Performance
1 hour ago
-
FAMILY SINNERS - Naughty Babe Demi Hawks Finally Gets In Her Hot Step Uncle Derrick Pierce's Pa
1 hour ago
-
Untitled
2 hours ago