#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
    vector<int> v;
    int input;
    while(cin>>input){
        v.push_back(input);
    }
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
    cout<<"\nsearching an element using binary search stl\n";
    int found=binary_search(v.begin(),v.end(),5);
    if(found==0)
        cout<<"5 is not found\n";
    else
        cout<<"5 is found\n";
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: