Contents:
[TOC]
排列
GO 排列组合
组合
todo
lower_bound
头文件:algorithm
lower_bound()返回值是一个迭代器,返回指向大于等于key的第一个值的位置;没找到就返回last位置
对象:有序数组或容器
1 2 3 4 5 6 7 8 9 10
| #include <algorithm> #include <iostream> using namespace std; int main() { int a[]={1,2,3,4,5,7,8,9}; printf("%d",lower_bound(a,a+8,6) - a);
return 0; }
|
输出为 5