加号(Plus)
题号:NC200221
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

牛牛给你一个只包含字符1到9的字符串S, 你现在可以在任意两个数字字符之间插入'+'号构成一个式子,现在希望你能求出所有式子的结果之和。
NiuNiu gives you a string contains only digit characters ‘1’ to ‘9’, and tell you that you can insert a ‘+’ for any number of times between any two characters to form a formula. Now he wants to know the sum of the results of all the different formulas that can be formed.

输入描述:

输入只包含一个数字字符的字符串

The input is a string S only contains digit characters ‘1’ to ‘9’. 

输出描述:

输出总和
Print the sum.
示例1

输入

复制
125

输出

复制
176

说明

可以得到插入的结果:
125(不插入)
1 + 25 =26
12 + 5= 17
1 + 2 + 5 = 8
所以答案为: 125 + 26 + 17 + 8 = 176。
All the possible formulas:
125 (insert no ‘+’)
1 + 25 = 26
12 + 5 = 17
1 + 2 + 5 = 8
So the answer is 125 + 26 + 17 + 8 = 176.
示例2

输入

复制
9999999999

输出

复制
12656242944