2015-06-09から1日間の記事一覧

lower_boundについて

#include <iostream> #include <string> using namespace std; int a[5] = {10, 20, 20, 40, 60}; int main() { cout << lower_bound(a, a + 5, 0) - a << endl; # 0 cout << lower_bound(a, a + 5, 20) - a << endl; # 1 cout << lower_bound(a, a + 5, 100) - a << endl; # 5</string></iostream>…