diff --git a/test.cpp b/test.cpp index 8650e68..a1489dc 100644 --- a/test.cpp +++ b/test.cpp @@ -6,7 +6,7 @@ int main() { int a[5] = {1, 3, 7 , 8 , 9}; - cout << upper_bound(a, a+5, 7)-a << endl; - cout << lower_bound(a, a+5, 1)-a << endl; + cout << a[upper_bound(a, a+5, 7)-a] << endl; + cout << a[lower_bound(a, a+5, 1)-a] << endl; return 0; }