2015东南大学计算机复试第一题

在这里插入图片描述`//2015.1
#include
#include
using namespace std;

int main(){
double x;
while(1){
cin>>x;
cout<<“exp(”<

	int n = 2;	
	int botton =1;
	double temp;
	double sum = 1+x;
	double judge;

	do{
		botton *=n; 
		temp = pow(x,n)/botton;
		sum += temp;
		n++;
		judge = fabs(temp-pow(x,n-1)/(botton/n))>1.0e-7;
	}while(judge);
	cout<

}`

你可能感兴趣的:(算法)