#include <iostream>
#include <string>
int main() {
using leaf_type = std::string[2];
leaf_type tree[5] =
{
{"1234", "1234-abcde"},
{"2345", "2345-bcdef"},
{"3456", "3456-cdefg"},
{"4567", "4567-defgh"},
{"5678", "5678-efghi"},
};
auto data = "3456";
for (auto* current = &tree[0]; current < tree+5; ++current)
{
if ((*current)[0] == data) {
std::cout << data << " exists with value " << (*current)[1] << '\n';
break;
}
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKCmludCBtYWluKCkgewogICAgdXNpbmcgbGVhZl90eXBlID0gc3RkOjpzdHJpbmdbMl07CgogICAgbGVhZl90eXBlIHRyZWVbNV0gPQogICAgewogICAgICAgIHsiMTIzNCIsICIxMjM0LWFiY2RlIn0sCiAgICAgICAgeyIyMzQ1IiwgIjIzNDUtYmNkZWYifSwKICAgICAgICB7IjM0NTYiLCAiMzQ1Ni1jZGVmZyJ9LAogICAgICAgIHsiNDU2NyIsICI0NTY3LWRlZmdoIn0sCiAgICAgICAgeyI1Njc4IiwgIjU2NzgtZWZnaGkifSwKICAgIH07CgogICAgYXV0byBkYXRhID0gIjM0NTYiOwoKICAgIGZvciAoYXV0byogY3VycmVudCA9ICZ0cmVlWzBdOyBjdXJyZW50IDwgdHJlZSs1OyArK2N1cnJlbnQpIAogICAgewogICAgICAgIGlmICgoKmN1cnJlbnQpWzBdID09IGRhdGEpIHsKICAgICAgICAgICAgc3RkOjpjb3V0IDw8IGRhdGEgPDwgIiBleGlzdHMgd2l0aCB2YWx1ZSAiIDw8ICgqY3VycmVudClbMV0gPDwgJ1xuJzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgfQp9