Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n,P1,P5,P10,P20,P60;
- cin>>n;
- P60=n/60;
- n=n%60;
- P20=n/20;
- n=n%20;
- P10=n/10;
- n=n%10;
- P5=n/5;
- n=n%5;
- P1=n;
- if (P1*15>=70)
- {
- P1=0;
- P5++;
- }
- if (P5*70+P1*15>=125)
- {
- P1=0;
- P5=0;
- P10++;
- }
- if (P10*125+P5*70+P1*15>=230)
- {
- P1=0;
- P5=0;
- P10=0;
- P20++;
- }
- if (440<=P20*230+P10*125+P5*70+P1*15)
- {
- P10=0;
- P1=0;
- P5=0;
- P20=0;
- P60++;
- }
- cout<<P1<<" "<<P5<<" "<<P10<<" "<<P20<<" "<<P60;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement