#include #include #include using namespace std; void LU(int n,double *a,double *b,double *c,double d,double e,double *pointx,double *pointy) { double *f=new double[n+1]; double *g=new double[n+1]; double *h=new double[n+1]; double *k=new double[n+1]; //求解得到h[],f[] h[1]=b[1]; for(int i=1;i=0;i--) { px[i]=(x[i]-c[i+1]*px[i+1]-k[i+1]*px[n-1])/h[i+1]; py[i]=(y[i]-c[i+1]*py[i+1]-k[i+1]*py[n-1])/h[i+1]; } px[n]=px[0];px[n+1]=px[1]; py[n]=py[0];py[n+1]=py[1]; //将排序后的端点写入到文件中 ofstream ftxt("e:\\me.txt"); if(!ftxt) { cout<<"创建文件失败!请检查文件写路径是否正确!"<> inum; double *pointx=new double[inum+1]; double *pointy=new double[inum+1]; string point_str; string xstr,ystr; float x,y; while(getline(intxt,point_str)) { xstr=point_str.substr(0,point_str.find_last_of(",")); ystr=point_str.substr(point_str.find_first_of(",")+1); istringstream xss(xstr); istringstream yss(ystr); xss >> x; yss >> y; pointx[j]=x; pointy[j]=y; //cout<