From dcff3b34117fb23dd6106965444a678310c058f7 Mon Sep 17 00:00:00 2001 From: Aniket <43602527+masteranimax@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:06:41 +0530 Subject: [PATCH] Update test.cpp --- test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }