C语言里的pow函数居然可以用小数,还是相当稳的,看来写C语言的泰勒展开学的不错啊
泰勒展开的用处还是主要位于近似值问题,在别处的应用(单纯解题不算应用)还有待了解啊
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <cstring>
#include <cmath>
#include <cstdlib>
#define AAA 30
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
double zhishu(double n,int cishu);
int main(int argc, char** argv) {
double a = 0;
while(a>-3)
{
for(int i=0;i<floor((pow(2.718,a)*AAA));i++)
{
printf("*");
}
a-=0.20;
printf("\n");
}
return 0;
//system("pause");
return 0;
}
改换其中的一些数据,可以作出形状比例不同的图像,需要根据要求确定