
This code is to find out the 3-digit numbers that have their digits add up to 9. The problem was originated from the “Problem of the week” from the university of Waterloo. The original question is stated here: https://www.cemc.uwaterloo.ca/resources/potw/2019-20/English/POTWD-19-NA-02-P.pdf
The digit positive integer is the sum of all of its digits. For example, the digit sum of the integer 1234 is 10, since 1 + 2+ 3 + 4 = 10. Find all three-digit positive integers whose digit sum is exactly 9.
This is the answer that I got, it can also be found out through running the code by pressing the green button:
108
117
126
135
144
153
162
Well, but there is another problem that I do not know how to solve. The problem can be found here: https://www.cemc.uwaterloo.ca/resources/potw/2019-20/English/POTWE-19-AE-02-P.pdf. If you find out the answer, please leave a comment!