ALCATRAZ1 - SUM OF DIGITS


You are being given a number N . (1<=N<=10^50) . You have to print the sum of digits of that particular number . 

Input

The first line will contain T , the number of testcases ( T<10) . The next T lines will contain the numbers whose sum of digits you have to calculate .  

Output

Output T lines  containing the Sum of Digits of the numbers .

Example

Input:
3
123123123
3434
1234567890
Output:
18
14
45

hide comments
karankeswani99: 2019-01-16 16:53:16

AC in one go :)

dwzy: 2018-12-18 02:45:38

java TLE :(

amantu_amir: 2018-10-30 19:25:43

In cpp take input as string and then convert into int(s[i] - 48) and sum them

Last edit: 2018-10-30 19:26:11
k10online: 2018-10-16 10:56:47

you can store the number as string and then convert one char to digit and sum it

aunkhtoo: 2018-10-15 10:42:58

can't solve in java
no way?

albiosz: 2018-09-20 12:37:19

In python it is easy, but how to store such a huge number as 123123123 in a string using Cpp? Cpp automatically converts it to the 1.23123123e08 and save this number in such format to a string :/

aquib_ansari: 2018-07-09 04:47:31

how to store such a huge number in cpp

anushka_ahuja: 2018-07-07 15:07:43

very easy !!!
AC in one go !!

cryo: 2018-06-02 13:31:26

easy one.take care about the input format

ankur314: 2018-05-18 05:20:58

convert every character of string to int and add


Added by:Alcatraz
Date:2016-11-04
Time limit:0.019s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU