- 博客(11)
- 收藏
- 关注
原创 模拟生产者消费者问题
// 操作系统实验一.cpp : 定义控制台应用程序的入口点。 //生产者-消费者问题代码实现 #include "stdafx.h" #include #include #include #include using namespace std; int static pv = 1; //p,v原语信号量.同一时间只能有一个p或v执行 i
2017-01-17 11:53:48
714
原创 亚当姆斯预报校正系统
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P109 #include "stdafx.h" #include using namespace std; int main() { #define f(x,y) (y-2*x/y) int n,p; double x[5], y[5], h, N; cout
2017-01-16 12:12:38
1011
原创 四阶龙格库塔法
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P105 #include "stdafx.h" #include "math.h" #include #define f(x,y) (y-2*x/y) using namespace std; int main() { double x0, x1, y0, y1, h, n,
2017-01-16 12:11:24
1344
原创 牛顿法
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P136 #include "stdafx.h" #include #define f(x) (x*exp(x)-1) #define g(x) (exp(x)+x*exp(x)) using namespace std; int main() { double x0, x1, e
2017-01-16 12:10:07
205
原创 龙贝格法
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P70 #include "stdafx.h" #include "math.h" #include using namespace std; int main() { #define f(x) (sin(x)/x) double a, b, e,h,T1,T2,S,x,
2017-01-16 12:08:59
344
原创 拉格朗日插值法
#include "stdafx.h" #include using namespace std; double Lagrange(double x[], double y[], double unknown) { double result = 0; double t = 1; //暂存累乘结果 for (int i = 0; y[i]; i++) { for (i
2017-01-16 12:07:30
303
原创 高斯赛德尔迭代法
// 高斯赛德尔迭代法.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "math.h" #include using namespace std; int main() { //输入 int k = 1; int N; //最大迭代次数 double x[200], y[200], b[200], d[2
2017-01-16 12:05:26
2688
1
原创 改进的欧拉格式法
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P101 #include "stdafx.h" #include "math.h" #include using namespace std; int main() { #define f(x,y) (y-2*x/y) double x0, x1, y0, y1, yp
2017-01-16 11:59:16
1215
原创 复化辛普森法
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P65 #include "stdafx.h" #include "math.h" #include #define f(x) sin(x)/x; using namespace std; int main() { double a, b, n,x,S; cout cin
2017-01-16 11:57:02
1359
原创 变步长梯形法
// ConsoleApplication1.cpp : 定义控制台应用程序的入口点。 //P67 #include "stdafx.h" #include "math.h" #include using namespace std; int main() { #define f(x) (sin(x)/x) double a, b, e, h, x, T1, T2,
2017-01-16 11:52:19
1910
原创 埃特金法
// 埃特金算法.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "math.h" #include #define f(x) exp(-x) using namespace std; int main() { double x[3], e, N; int k = 1; cout cin >> x[0] >>
2017-01-16 11:42:08
795
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人