Created
March 23, 2017 16:43
-
-
Save abdalla/83a3b81342bcea58fdc313ae5bce61ce to your computer and use it in GitHub Desktop.
for_fun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exchange = vl => { | |
const nr_qt = Math.floor(vl/25); | |
console.log(nr_qt); | |
let rest = vl - (nr_qt * 25); | |
const nr_dim = Math.floor(rest/10); | |
console.log(nr_dim); | |
rest -= nr_dim * 10; | |
const nr_nik = Math.floor(rest/5); | |
console.log(nr_nik); | |
const nr_pen = rest - nr_nik * 5; | |
console.log(nr_pen); | |
} | |
exchange(110); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment