You and your friend decided to bake an apple pie. However, you don't know how many apples you have in total. So, your friend wrote a program that calculates the sum of apples as the sum of unsigned integers.
It does not work correctly now. Find and fix errors in this program.