#CCBCHMOT0000015. Đếm chữ số của 0 (Digit Count Including Zero)
Đếm chữ số của 0 (Digit Count Including Zero)
Digit Count Including Zero
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given a nonnegative integer n, count the digits in its ordinary decimal representation, without leading zeroes. The number 0 is represented by one digit, so its answer is 1.
Input
One nonnegative integer n.
Output
Print the number of decimal digits in n.
Subtasks
- Subtask 1 (20%): 0 <= n <= 9.
- Subtask 2 (30%): 0 <= n <= 100000.
- Subtask 3 (50%): 0 <= n <= 10^18.
Examples
Example 1
Input
0
Output
1
Explanation
Zero has one decimal digit.
Example 2
Input
1000
Output
4
Explanation
Integer division by 10 gives 1000,100,10,1,0: four divisions.