store the digits in an array
digit . push_back ( n % 10 ) ; n /= 10 ; } reverse ( digit . begin ( ) , digit . end ( ) ) ; bool flag = true ; n = digit [ 0 ] ; for ( int i = 1 ; i < digit . size ( ) ; i ++ ) {