Check if i and n - i doesn 't  contain k in them print i and n-i
if ( freqCount ( to_string ( i ) , ( char ) ( k + 48 ) ) == 0 and freqCount ( to_string ( n - i ) , ( char ) ( k + 48 ) ) == 0 ) { cout << " ( " << i << " , ▁ " << n - i << " ) " ; flag = 1 ; break ; } }