daily pastebin goal
44%
SHARE
TWEET

Untitled

Gideer Mar 18th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4.  int values[] = {250000000, 100000000,50000000,25000000,10000000,
  5.     5000000,1000000,750000,500000,250000,200000,100000,50000,10000,5000,1000,500,
  6.     100,50,20,10,5};
  7. int cash;
  8.  
  9. void print(int bill){
  10.     if(cash < bill) return;
  11.     int temp = cash/bill;
  12.     cash -= temp*bill;
  13.     while (temp--){
  14.         std::cout << bill << std::endl;
  15.     }
  16. }
  17.  
  18. int main(){
  19.     std::cin >> cash;
  20.     std::for_each(values,values+22,print);
  21.     return 0;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top