## 求100-1000所有的水仙花数,每行打印两个水仙花数,并打印水仙花的个数;
求100-1000所有的水仙花数,每行打印两个水仙花数,并打印水仙花的个数;
水仙花数就是一个三位数的个位十位百位各自的立方和等于这个三位数本身的数,比如371 = 3^3 + 7^3 + 1^3;371就是一个水仙花数;
public class ShuiXianHua{
public static void main(String[] args){
int count = 0;
for(int i = 100; i <= 999; i++){
int ge = i % 10;
原创
2020-09-26 21:42:58 ·
1390 阅读 ·
0 评论