Function to check out whether the number is Munchhausen Number or not
static bool isMunchhausen ( int n ) { long sum = 0 ; int temp = n ; while ( temp > 0 ) { int index = temp % 10 ; sum = sum + pwr [ index ] ; temp /= 10 ; } return ( sum == n ) ; } static void printMunchhausenNumbers ( int n ) { pwr = new long [ 10 ] ;