#C7639. Sum of Digits

    ID: 51532 Type: Default 1000ms 256MiB

Sum of Digits

Sum of Digits

You are given a positive integer n. Your task is to compute the sum of its digits, denoted by \( S(n) \). For instance, if \( n = 123 \), then \( S(123) = 1 + 2 + 3 = 6 \).

The input begins with an integer \( T \) representing the number of test cases. Each of the following \( T \) lines contains one integer \( n \). For every test case, output the sum of the digits of \( n \) on a new line.

Note: \( n \) can be a very large number, so it is recommended to handle it as a string to avoid any integer overflow issues.

inputFormat

The first line of input contains a single integer \( T \) (\(1 \le T \le 10^5\)), the number of test cases. Each of the following \( T \) lines contains a positive integer \( n \) where \( 0 \le n \le 10^{100} \).

outputFormat

For each test case, output a single line containing the sum of the digits of the given integer \( n \).

## sample
3
123
4567
89
6

22 17

</p>