#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
double calculateE( int );
int main()
{
int expOfE;
cout << " Enter the exception of e:";
cin >> expOfE;
cout << fixed << setprecision( 10 );
cout << calculateE( expOfE ) << endl;
}
double calculateE( int exp )
{
double result = 1;
int x = exp;
int i = 1;
double poly = 1;
while( exp > 10e-10)
{
poly *= (x * poly / i);
result += poly ;
exp--;
}
return result;
}
Southeast University C++复试:2011_01
猜你喜欢
转载自blog.csdn.net/qq_35591140/article/details/105503347
今日推荐
周排行