32. Count the Digits
Foundation1000 ms256 MBSolved by 0%
Read a non-negative integer and print how many digits it has.
The number 0 has one digit.
Constraints - `0 ≤ n ≤ 1000000000000000000`
Input
A single line containing one integer n.
Output
Print one integer — how many digits the number has. The number 0 has one digit.
Input4207
Output4
Noteis a four digit number
Input0
Output1
Noteis zero, which has one digit — a `while n > 0` loop never runs and would answer 0
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution