题解 | #变种水仙花#
变种水仙花
http://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71
public class Main {
public static void main(String[] args) {
for (int i = 10000; i < 100000; i++) {
int sum = 0;
for (int j = 10000; j >= 10 ; j /= 10) {
int a = i / j;
int b = i % j;
sum += a * b;
}
if (i == sum) {
System.out.print(i + " ");
}
}
}
}