C++
持之以恒_fighting
人生的冷暖 取决于 自己心灵的高度
展开
-
C++优先队列的基本使用方法
#include #include #include using namespace std; struct node { friend bool operator< (node n1, node n2) { return n1.priority "为从小打到排列 } int priority; int value; }; int mai转载 2017-04-03 13:33:48 · 506 阅读 · 0 评论 -
sort & qsrot
头文件: #include using namespace std; 1.默认的sort函数是按升序排。对应于1) sort(a,a+n); //两个参数分别为待排序数组的首地址和尾地址 int cmp( const int &a, const int &b) { if( a > b ) return 1; else return转载 2017-04-03 13:42:16 · 229 阅读 · 0 评论