标签:pre int ble https col href lse span i++
https://pintia.cn/problem-sets/12/problems/354
1 double fn(double x, int n) 2 { 3 double ret; 4 double item, flag; 5 6 if (n == 1) 7 { 8 ret = x; 9 } 10 else 11 { 12 if (n % 2) 13 { 14 flag = 1; 15 } 16 else 17 { 18 flag = -1; 19 } 20 item = 1; 21 for (int i = 1; i <= n; i++) 22 { 23 item = item * x; 24 } 25 item = item * flag; 26 ret = fn(x, n - 1) + item; 27 } 28 29 return ret; 30 }
标签:pre int ble https col href lse span i++
原文地址:https://www.cnblogs.com/2018jason/p/12233422.html