A. Digits Sum
Let’s define S(x) to be the sum of digits of number x written in decimal system. For example, S(5)=5, S(10)=1, S(322)=7.
We will call an integer x interesting if S(x+1)<S(x). In each test you
will be given one integer n. Your task is to calculate the number of
integers x such that 1≤x≤n and x is interesting.Input The first line contains one integer t (1≤t≤1000) — number of
test cases.Then t lines follow, the i-th line contains one integer n (1≤n≤109)
for the i-th test case.Output Print t integers, the i-th should be the answer for the i-th
test case.
题意:s(n)表示的是当前数所有位之和,S(322)=3+2+2=7,让你求当前数字内s(n+1)<s(n)的情况的个数
个人思路:这道题仔细看题的例子就会发现很多数都是/10后得到正确答案,这的确是思路,但是当时没考虑个位为9这个特别的例子
思路:我们先来1-10中间的,能被称为有趣数的也只有s(9) (s(9)=9, s(10)=1),
然后在1-20答案为s(9),s(19)也就是说每10个中就只有一个数能满足