fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long n;
  6. cin >> n;
  7.  
  8. int price[] = {100, 20, 10, 5, 1};
  9. long long amount = 0;
  10.  
  11. for (int i = 0; i < 5; ++i) {
  12. amount += n / price[i];
  13. n -= price[i] * (n / price[i]);
  14. }
  15.  
  16. cout << amount << endl;
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
0