Functions
Function-35
Function-36
Function-37
~/algor $ cat problems/funksiya-raqamlar-soni
Digit count function
Easy
1000 ms
128 MB
29%
Write a function DigitCount(x) that returns the number of digits of the integer $x$. The minus sign is not a digit; $0$ has one digit.
Example 1: DigitCount(12345) → 5
Example 2: DigitCount(-907) → 3
Write only the function body.
Input
One line with an integer $x$ — the argument of the function.
Output
The value returned by the function: an integer.
Note
$-10^{15} \le x \le 10^{15}$
Examples
Input #1
12345
Output #1
5
Input #2
-907
Output #2
3