public class tjsxhgs01 {
public static void main(String[] args) {
System.out.println("程序开始");
int sxh = 0;
for (int i = 100; i < 1000; i++) {
int ge = i % 10;
int shi = i / 10 % 10;
int bai = i / 10 /10 % 10;
if (ge*ge*ge + shi*shi*shi + bai*bai*bai == i ) {
sxh ++;
}
}
System.out.println("水仙花共有:" + sxh + "个");
}
}
水仙花统计程序
最新推荐文章于 2024-09-10 10:21:38 发布