#E. 考级202209-5:数1的个数

    Type: Default 1000ms 256MiB

考级202209-5:数1的个数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给定一个十进制正整数n,写下从1到n的所有整数,然后数一下其中出现的数字“1”的个数。

例如当n=2时,写下1,2。这样只出现了1个“1”;当n=12时,写下1,2,3,4,5,6,7,8,9,10,11,12。这样出现了5个“1”。

输入格式

正整数n。1 <= n <= 10000。

输出格式

一个正整数,即“1”的个数。

输入样例数据 1

12

输出样例数据 1

5

数据范围与提示

1 <= n <= 10000

一级第10轮

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
5
Start at
2023-8-1 9:30
End at
2023-8-20 3:30
Duration
450 hour(s)
Host
Partic.
14