#include
#include
double fact(int n) {
if (n < 2) return 1.0;
double m = 1.0;
for (int i = 2; i <= n; ++i) m *= i;
return m;
}
int main(void) {
int m;
double x;
double e = 0.0;
printf("x: ");
scanf("%lf", &x);
printf("n: ");
scanf("%d", &m);
for (int n = m; n; --n) {
e += pow(x, n) / fact(n);
}
printf("result: %.15lf\n", e);
printf("exp(%lf): %.15lf\n", x, e);
return 0;
}