fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8. int a[] = {1,2,3,4,5,6,7,8,9,10};
  9.  
  10. bool found = binary_search(a,a+10,1);
  11. cout<<found<<endl;
  12. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1