Problem D: 求数位和
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:63
Solved:18
Description
给定一个正整数 N。计算从 1到 N的所有数的各位数字之和的总和 S。
例如 n=12 ,则总和 S = 1+2+3+4+5+6+7+8+9+1+2+3=51。
其个位教1~9 直接加和为45,再加上10为1+0=1,11为1+1=2,12为1+2=3,其数位和S为 51。
Input
输入一个正整数 N 。
Output
输出 1~ N 的数位和。
Sample Input Copy
123
Sample Output Copy
1038
HINT
1=<N<=10^9