算法
percy宣森213
这个作者很懒,什么都没留下…
展开
-
最近对问题(分治法)
#include "stdafx.h" #include #include using namespace std; struct point { double x, y; }; double Distance(point a, point b);//声明函数,否则在c++中会出现“找不到标示符”的错误 double ClosestDistance(point s[]原创 2015-04-03 21:27:13 · 449 阅读 · 0 评论 -
01背包问题
#include "stdafx.h" #include #include using std::vector; using namespace std; void Print(int maxvalue, int a[],vector &w) { cout << "最大的价值是:" << maxvalue<<endl; cout << "选择的物品是"; for (int i = 0; i原创 2015-04-05 14:43:10 · 213 阅读 · 0 评论