#include <stdio.h>
int main(void) {
while (true)
{
float x;
scanf("%f", &x);
float xs = 1;
float ps = 1;
float d = xs / ps;
float r = d;
int i = 1;
while (d > 0.0001)
{
xs *= x;
ps *= i++;
d = xs / ps;
r += d;
}
printf("%.2f\n", r);
}
return 0;
}
https://download.csdn.net/download/caozhy/10766667
如果问题得到解决请点我回答左上角的采纳,谢谢