Skip to content

Instantly share code, notes, and snippets.

@ChanChar
Created January 31, 2015 19:33
Show Gist options
  • Save ChanChar/a178b5c164fb9e212c7d to your computer and use it in GitHub Desktop.
Save ChanChar/a178b5c164fb9e212c7d to your computer and use it in GitHub Desktop.
1/31/2015 Problem of the Day Solution
# answer = A * B + C
# Return the sum of the digits of the answer
def sum_of_digits(number):
digits = [int(digit) for digit in list(str(number))] # Create a list of digits
return sum(digits) q # Then return the sum of the digits
number_of_cases = int(input())
for case in range(number_of_cases):
new_case = [int(number) for number in input().split()]
a, b, c = new_case[0], new_case[1], new_case[2]
answer = a * b + c
print(sum_of_digits(answer), end=' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment