Author | Message |
---|---|
harry_520
Posts: 76
|
Posted 19:20 Nov 03, 2013 |
Dr, Sun, can you give us the solution of exercise 4? |
cysun
Posts: 2935
|
Posted 22:10 Nov 03, 2013 |
No. I don't give out solutions. |
cydneyauman
Posts: 12
|
Posted 10:24 Nov 04, 2013 |
Harry_520 - while I did not get the solution right during the exercise - i did come up with a solution after thinking about the problem a bit longer. you can solve the sum of digits by using a loop and modulo and division. the basic idea it to isolate each digit and then add that digit to a result variable then do it all over again with the remaining digits. i obviously can't post the exact solution, but hopefully this logic helps. |