#include"stdio.h" double fac(int n) //阶乘!!!!!!!! { double out ; if( n == 0) out = 1; else if ( n == 1) out = 1; else out = n * fac(n - 1); return out; } int main() { double result; printf("n e\n- -----------\n0 1\n1 2\n2 2.5\n"); for(int i = 3; i < 10; i++) { result = 2.5; for(int j = 3; j <= i; j++) { result += 1.0/fac(j); } printf("%d %.9lf\n", i, result); } return 0; }