//#include "stdafx.h"//If the vc++6.0, with this line.
#include "stdio.h"
int main(void){
int n,i;
double x,relt,t;
printf("Input n & x(n int/x double)...\n");
scanf("%d%lf",&n,&x);
for(relt=t=i=1;i<=n;relt+=(t*=x)/=i++);
printf("The result is %f.\n",relt);
return 0;
}
加一个中间值Y.和就是S,具体的自己写
Y=1,S=1;
for(i=1,i<=N,i++)
{
Y=Y*X/i;
S+=Y;}