1#include <iostream>
22 #include <array>
33 #include <string>
44 #include <algorithm>
55
66 using namespace std;
77
88 int main(){
99 array<string, 4> colours = {"blue", "black", "red", "green"};
1010 sort(colours.begin(), colours.end()); //must be sorted
1111 string key = "black";
1212 //look for black
1313 bool found = binary_search(colours.begin(), colours.end(), key);
1414 if (found){
1515 cout << "We found the key 'black'" << endl;
1616 }
1717 return 0;
1818 }