使用泰勒展开doublesinTaylor(doublex,intterms){doubleresult=0.0;intsign=1;for(intn=0;n<terms;+...
int exponent = 2 * i + 1;double term = pow(-1, i) * pow(x, exponent) / factorial(expo...