Change bool to int
if ( digits [ i - 1 ] != '0' ) { dig1 = 1 ; } if ( digits [ i - 2 ] == '1' ) { dig2 = 1 ; } else dig2 = 0 ; if ( digits [ i - 2 ] == '2' && digits [ i - 1 ] < '7' ) { dig3 = 1 ; } count2 = dig1 * count1 + dig2 + dig3 * count0 ; count0 = count1 ; count1 = count2 ; }