For every uppercase letter found map that uppercase to original words
if ( words [ i ] [ j ] >= ' A ' && words [ i ] [ j ] <= ' Z ' ) { str += words [ i ] [ j ] ; map [ str ] . push_back ( words [ i ] ) ; } } } bool wordFound = false ;