fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define GG ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  4. int main () { GG;
  5. int n, DU[5]={1,5,10,20,100},ans=0,x;
  6. cin>>n;
  7. for(int i=4;i>=0;i--)
  8. { x=n/DU[i];
  9. ans+=x;
  10. n-=x*DU[i];
  11. //cout<<x<<" ";
  12. }
  13.  
  14. cout<<ans<<"\n";
  15. return 0;}
Success #stdin #stdout 0.01s 5304KB
stdin
1000000000
stdout
10000000