You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
663 B

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

问题描述
  一个正整数如果任何一个数位不大于右边相邻的数位,则称为一个数位递增的数,
例如1135是一个数位递增的数而1024不是一个数位递增的数。
  给定正整数 n请问在整数 1 至 n 中有多少个数位递增的数?
输入格式
  输入的第一行包含一个整数 n。
输出格式
  输出一行包含一个整数,表示答案。
样例输入
30
样例输出
26
评测用例规模与约定
  对于 40% 的评测用例1 <= n <= 1000。
  对于 80% 的评测用例1 <= n <= 100000。
  对于所有评测用例1 <= n <= 1000000。