摘要: 数值计算:这种积分的计算方法很好,学习一下!代码: 1 #include 2 #include 3 using namespace std; 4 const double eps = 10e-5; 5 6 double func(double a, double b, double x) 7 { 8 double r = a * exp(- x*x) + b * sqrt(x); 9 return r*r;10 }11 12 double integrate(double a, double b, double h)13 {14 unsigned long ste... 阅读全文
posted @ 2013-10-20 16:56 Yours1103 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 一个离散化的简单题;我用的是STL来做的离散化;好久没写离散化了,纪念一下!代码: 1 #include 2 #include 3 #include 4 #include 5 #define maxn 5005 6 using namespace std; 7 vectorve; 8 int mmb[12]={0,44640,84960,129600,172800, 9 217440,260640,305280,349920,393120,437760,480960};10 struct node11 {12 int st,end;13 }no[maxn];14 15 char s[1... 阅读全文
posted @ 2013-10-20 16:21 Yours1103 阅读(236) 评论(0) 推荐(0) 编辑