S4P1 - Sum of factorial
Mohamed has a new task and as you are Mohamed's friend he asks you to develop perform this task .Task is about calculate sum of factorial for all digits in an integer number N.
Input
The input contains N where 1 ≤ N ≤ 1000000000000.
Output
Sum of factorial for all digits in N.
Print a new line after the output.
Example
Input: 2431 Output: 33
Added by: | mohamed gamal |
Date: | 2012-01-27 |
Time limit: | 2s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C++ 4.3.2 CPP |