lower_bound下确界

 1 //lower_bound用于找到首个大于等于某个值的元素
 2 #include<algorithm>
 3 #include<iostream>
 4 
 5 using namespace std;
 6 
 7 int main()
 8 {
 9     int a[] = {23, 9, 7, 2, 3, 4};
10     int len = sizeof(a)/int(a);
11     int *x = lower_bound(a, a+len, 7);  //直接输出为0x的形式
12     cout<<"不小于7的下确界元素"<<*x;
13     cout<<endl;
14 
15     system("pause");
16 
17     return 0;
18 }
永远渴望,大智若愚(stay hungry, stay foolish)
原文地址:https://www.cnblogs.com/h-hkai/p/8321087.html