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
aunkhtoo:
2018-10-15 10:42:58
can't solve in java
|
|
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 !!!
|
|
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
|
|
dipankar12:
2018-05-12 12:53:16
Nobody has ever solved this in JAVA. I think time limit for JAVA is way too strict. |
|
nesdi:
2018-04-15 12:41:45
TLE with Java |
Added by: | Alcatraz |
Date: | 2016-11-04 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |