Interesting Numbers
Given an integer n, determine how many integers x (where 1 †x †n) are interesting. An integer x is considered interesting if the sum of its digits decreases when incremented by 1, i.e., S(x+1) < S(x), where S(x) represents the sum of the digits of x in the decimal system.
Your task is to count how many such interesting numbers exist within the given range.
Example 1
Input:
9
Output:
1
Example 2
Input:
19
Output:
2
Example 3
Input:
1
Output:
0
main.cpp
C++
AIã«è³ªåãã
AIã«è³ªåãã
äœã§ã質åããããææ¡ããã質åã®1ã€ã詊ããŠãã£ãããå§ããŠãã ãã