书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

2012年3月21日

lower_bound的用法

摘要: lower_bound的headfile是algorithm.lower_bound的工作原理就是二分查找了。lower_bound的作用:lower_bound的返回值减去数组的地址就是要查找的元素在数组中的位置。即:Pos = lower_bound(a, a+10, 3)-a;那么Pos就是在数组a[10]中的位置了。下面给出它的具体用法并说明一些要注意的问题。View Code #include "iostream"#include "algorithm"using namespace std;int main(){ int a[4]={1, 2 阅读全文

posted @ 2012-03-21 22:13 More study needed. 阅读(903) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

点击右上角即可分享
微信分享提示