Skip to content

Commit

Permalink
Merge pull request #28 from thebadal01/thebadal01-money-change-algo
Browse files Browse the repository at this point in the history
add c++ code for money change algo
  • Loading branch information
keshavagarwal17 authored Oct 1, 2021
2 parents 3134d8b + 86042f3 commit 51482db
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions moneyChange.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll m;
cin>>m;
ll a = m/10;
m -= a * 10;
ll b = m/5;
m -= b * 5;
ll c = m;
ll n = a + b + c;
cout << n << endl;
}

0 comments on commit 51482db

Please sign in to comment.