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 .
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 T lines containing the Sum of Digits of the numbers .
AC in one go :)
java TLE :(
In cpp take input as string and then convert into int(s[i] - 48) and sum them
you can store the number as string and then convert one char to digit and sum it
can't solve in java
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 :/
how to store such a huge number in cpp
very easy !!!
easy one.take care about the input format
convert every character of string to int and add