Processing a string
All submissions for this problem are available.
Given an alphanumeric string made up of digits and lower case Latin characters only, find the sum of all the digit characters in the string.
- The first line of the input contains an integer T denoting the number of test cases. Then T test cases follow.
- Each test case is described with a single line containing a string S, the alphanumeric string.
- For each test case, output a single line containing the sum of all the digit characters in that string.
- 1 ≤ T ≤ 1000
- 1 ≤ |S| ≤ 1000, where |S| is the length of the string S.
Input: 1 ab1231da Output: 7
The digits in this string are 1, 2, 3 and 1. Hence, the sum of all of them is 7.
|Tags||acmkol15, conversion, pnkjjindal, simple, strings|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.