This solution is outdated. To rescore this solution, sign in.
-
1 Comment
Haoyu Dai
on 4 May 2020
function b = makingChange(a)
cu=[10000,5000,2000,1000,500,200,100,50,25,10,5,1];
b=[];
m=a*100;
for i=1:11
b(i)=floor(m/cu(i));
m=m-b(i)*cu(i);
end
b(12)=m;
end
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!