0
anyone know coding on how to count number of coins and notes?
//Example money= 51230 Number of Coins/Notes Thousand - 51 Five Hundred - 0 Hundred - 2 Fifty - 0 Twenty - 1 Ten - 1 Five - 0 Two - 0 One - 0
2 Respuestas
+ 1
id use %
int num = 8291;
ones = num % 10;
tens = num % 100 - ones
hund = num % 1000 - tens -ones
...
so on. you could also start from the highest, assuming you know a maximum and just go backwards. but just have num be the result
0
Make divider rules first. Then count. You can check my post code.