Count Digits and Digit Sum
Easyjavapythonccppjavascript
Given a non-negative integer N, find the number of digits it has and the sum of those digits.
Input Format
A single line containing the integer N.
Output Format
Print two lines: Digits = d Sum = s
Example 1
Input
5824
Output
Digits = 4 Sum = 19
Explanation: 5824 has four digits and 5 + 8 + 2 + 4 = 19.
- 0 <= N <= 1000000000000000000
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Check Prime NumberEasy · java, python, c, cpp, javascriptSolve Problem
- Greatest Common DivisorEasy · java, python, c, cpp, javascriptSolve Problem
- Least Common MultipleEasy · java, python, c, cpp, javascriptSolve Problem