Thirty-seven ------------ Given an input string of 13 digits, the problem is to find the number of possible combinations of those digits whose sum is 37. Interpret a 0 in the string as 10. For example, there are four combinations of digits from the string 1273132012321: 1 2 7 3 1 3 2 0 1 2 3 2 1 ------------------------------------- 2 +7 +3 +1 +3 +2+10 +1 +2 +3 +2 +1 = 37 1 +2 +7 +3 +3 +2+10 +1 +2 +3 +2 +1 = 37 1 +2 +7 +3 +1 +3 +2+10 +2 +3 +2 +1 = 37 1 +2 +7 +3 +1 +3 +2+10 +1 +2 +3 +2 = 37 The string 4444444441111 also has 4 combinations that sum to 37: 4 4 4 4 4 4 4 4 4 1 1 1 1 ------------------------------------- 4 +4 +4 +4 +4 +4 +4 +4 +4 +1 +1 +1 = 37 4 +4 +4 +4 +4 +4 +4 +4 +4 +1 +1 +1 = 37 4 +4 +4 +4 +4 +4 +4 +4 +4 +1 +1 +1 = 37 4 +4 +4 +4 +4 +4 +4 +4 +4 +1 +1 +1 = 37 Input Format ------------ Each line will contain a string of 13 characters. An input of 0000000000000 indicates the end of the input. Output Format ------------- See sample output. Do not generate any output for the last line of the input Sample Input ------------ 1273132012321 4444444441111 8749372132333 1333333333333 0000000000000 Sample Output ------------- String 1273132012321 has 4 combination(s) totalling 37. String 4444444441111 has 4 combination(s) totalling 37. String 8749372132333 has 219 combination(s) totalling 37. String 1333333333333 has 1 combination(s) totalling 37.