/**
* 找到比输入的整数大的下一个水仙花数
* @param n int整型 输入的整数
* @return long长整型
*/
public static long nextNarcissisticNumber (int n) {
if(n<9) return n+1;
int count,flower,temp;
int j = 0;
while(true) {
temp = n+(++j);
count = 0;
flower = 0;
// 判断是几位数
while(temp!=0) {
temp = temp/10;
count++;
}
temp = n+j;
// 计算,判断当前数是否为水仙花数,如果是则跳出while循环
for(int i=0;i<count;i++,temp=temp/10) flower += Math.pow(temp%10,count);
if(flower==n+j) break;
}
return flower;
}