Marshal's confusion II | ||||||
| ||||||
Description | ||||||
one day, Marshal want to show the answer :Calculate S(n). S(n)=1^3+2^3 +3^3 +......+n^3 . | ||||||
Input | ||||||
Each line will contain one integer N(1 < n < 1000000000). Process to end of file. | ||||||
Output | ||||||
For each case, output the last four dights of S(N) in one line. | ||||||
Sample Input | ||||||
1 2 | ||||||
Sample Output | ||||||
0001 0009 公式:S(n)=1^3+2^3 +3^3 +......+n^3=[n(n+1)/2]^2
|
Hust oj 1196 Marshal's confusion II(公式)
最新推荐文章于 2025-01-05 10:36:23 发布