#include <iostream>
#include <iterator>
#include <string>
std:: string yours[ ] = {
"cxf341" ,
"rmj441" ,
"zmw562" ,
"987abcd"
} ;
auto yours_length = std:: end ( yours) - std:: begin ( yours) ;
std:: string mine[ ] = {
"cxf341" ,
"987abcd" ,
"rmzddd" ,
"rmj441"
} ;
auto mine_length = std:: end ( mine) - std:: begin ( mine) ;
int main( ) {
for ( auto i = std:: size_t { 0 } ; i < mine_length; ++ i)
{
auto matched = false ;
for ( auto j = std:: size_t { 0 } ; j < yours_length && ! matched; ++ j)
{
if ( mine[ i] == yours[ j] ) {
std:: cout << mine[ i] << " has a match in mine[" << i << "] and yours[" << j << "]\n " ;
matched = true ;
}
}
if ( ! matched) {
std:: cout << mine[ i] << " has no match in yours.\n " ;
}
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxzdHJpbmc+CgpzdGQ6OnN0cmluZyB5b3Vyc1tdID0gewogICJjeGYzNDEiLAogICJybWo0NDEiLAogICJ6bXc1NjIiLAogICI5ODdhYmNkIgp9OwoKYXV0byB5b3Vyc19sZW5ndGggPSBzdGQ6OmVuZCh5b3VycykgLSBzdGQ6OmJlZ2luKHlvdXJzKTsKCgpzdGQ6OnN0cmluZyBtaW5lW10gPSB7CiAgImN4ZjM0MSIsCiAgIjk4N2FiY2QiLAogICJybXpkZGQiLAogICJybWo0NDEiCn07CgphdXRvIG1pbmVfbGVuZ3RoID0gc3RkOjplbmQobWluZSkgLSBzdGQ6OmJlZ2luKG1pbmUpOwoKCmludCBtYWluKCkgewogICAgZm9yIChhdXRvIGkgPSBzdGQ6OnNpemVfdHsgMCB9OyBpIDwgbWluZV9sZW5ndGg7ICsraSkgCiAgICB7CiAgICAgICAgYXV0byBtYXRjaGVkID0gZmFsc2U7CiAgICAgICAgZm9yIChhdXRvIGogPSBzdGQ6OnNpemVfdHsgMCB9OyBqIDwgeW91cnNfbGVuZ3RoICYmICFtYXRjaGVkOyArK2op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