Sum Of Digits (Updated)

2.4

56 votes
Problem

Given number N, print sum of all of its digits.

Input

First Line of input contains integer T denoting number of test cases.
Next T lines contains number N

Output

For each test case, print sum of digits of number N.

Constraints

1 <= T <= 10

Number of digits in N in range [1, 10000000]

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?