//参数number是待判断的正整数,n为正整数位数(3位则为水仙花数),满足条件则返回1,反之返回0
bool isZiMiShu(int number, int n) {
int __num = number, a[n], sum = 0, i = 0;
while (number > 0) {
a[i] = number % 10;
sum += pow(a[i], n);
number = (number - number % 10) / 10;
i++;
}
return (__num == sum && __num/pow(10, n-1) > 1);
}