Created
January 31, 2015 19:33
-
-
Save ChanChar/a178b5c164fb9e212c7d to your computer and use it in GitHub Desktop.
1/31/2015 Problem of the Day Solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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