
学习笔记 STL c++
文章平均质量分 68
A8572785
出污泥而不染!
展开
-
STL源码剖析-increment/decrement/dereference操作符
#include using namespace std; class INT { friend ostream& operator public: INT(int i):m_i(i){}; //前置式prefix:increment and then fetch INT& operator++() { ++(thi原创 2012-06-07 16:42:21 · 529 阅读 · 0 评论 -
一种背包问题的解法
一个体积为V的背包,现在有体积分别为(w1, w2, w3, w4, w5, w6......)i个物体,如何从中选取若干个物体放满背包: 以下是我的代码,主要采用了回朔的思想。 #include void baibao(int a[], int n, int v) { int sum=0; int index[10]={0}; int q=0; int j,i; sum = a原创 2012-08-23 13:18:42 · 556 阅读 · 0 评论