[Cpp] <p>/* </p> <p> question: Chinese... description of exponential functions: http://hi.baidu.com/nicker2010/item/fea0a5254208a30377272ced </p> <p> */</p> <p> # include <iostream> # include <cmath> using namespace std; # define manx 13 double a [manx], B [manx]; // a [] indicates the long num [manx] coefficient of the first equation; long fan (int n) {long sum = 1; for (int I = 1; I <= n; I ++) sum * = I; return sum ;} int main () {int n, m; while (cin> n> m) {memset (B, 0, sizeof (B); memset (a, 0, sizeof (a); for (int I = 0; I <n; I ++) cin> num [I]; for (int I = 0; I <= num [0]; I + +) a [I] = 1.0/fan (I); for (int I = 1; I <n; I ++) {// start with the second formula... for (int j = 0; j <manx; j ++) // The first formula x ^ j. The coefficient is a [j]... for (int k = 0; k <= num [I] & k + j <manx; k ++) {// x ^ k of the second formula, the coefficient of x ^ K is 1 B [j + k] + = a [j]/fan (k);} for (int j = 0; j <manx; j ++) {a [j] = B [j]; B [j] = 0 ;}} printf ("%. lf \ n ", a [m] * fan (m); // combined mathematics }}</p>