В
Size: a a a
В
В
В
Q
Q
const iWantToGet = ammountRequired => {
const availibleNotes = [500, 200, 100, 50, 20, 10];
let result = 0;
if (ammountRequired > 0) {
for (let i = 0; i < availibleNotes.length; i ++) {
let note = availibleNotes[i];
while (ammountRequired - note >= 0) {
ammountRequired -= note;
result++;
}
}
if (ammountRequired > 0) {
return -1;
}
} else {
console.log("Введите сумму");
}
return result;
};
S
const iWantToGet = ammountRequired => {
const availibleNotes = [500, 200, 100, 50, 20, 10];
let result = 0;
if (ammountRequired > 0) {
for (let i = 0; i < availibleNotes.length; i ++) {
let note = availibleNotes[i];
while (ammountRequired - note >= 0) {
ammountRequired -= note;
result++;
}
}
if (ammountRequired > 0) {
return -1;
}
} else {
console.log("Введите сумму");
}
return result;
};
НА
DE
const iWantToGet = ammountRequired => {
const availibleNotes = [500, 200, 100, 50, 20, 10];
let result = 0;
if (ammountRequired > 0) {
for (let i = 0; i < availibleNotes.length; i ++) {
let note = availibleNotes[i];
while (ammountRequired - note >= 0) {
ammountRequired -= note;
result++;
}
}
if (ammountRequired > 0) {
return -1;
}
} else {
console.log("Введите сумму");
}
return result;
};
Q
DE
Q
Q
DE
Q
DE
Q
Q
DE