Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- int values[] = {250000000, 100000000,50000000,25000000,10000000,
- 5000000,1000000,750000,500000,250000,200000,100000,50000,10000,5000,1000,500,
- 100,50,20,10,5};
- int cash;
- void print(int bill){
- if(cash < bill) return;
- int temp = cash/bill;
- cash -= temp*bill;
- while (temp--){
- std::cout << bill << std::endl;
- }
- }
- int main(){
- std::cin >> cash;
- std::for_each(values,values+22,print);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement