If any of the states is true , that is , if either the number of a ' s ▁ or ▁ number ▁ of ▁ b ' s or number of c 's  is a multiple of three, then the string is accepted
if ( checkA ( s , x ) || checkB ( s , x ) || checkC ( s , x ) ) { cout << " ACCEPTED " ; } else { if ( flag == 0 ) { cout << " NOT ▁ ACCEPTED " ; return 0 ; } else { cout << " INPUT ▁ OUT ▁ OF ▁ DICTIONARY . " ; return 0 ; } } }