1 public class hello { 2 3 /** 4 * @param args 5 */ 6 public static void main(String[] args) { 7 int ge = 1000; 8 int shi = 0; 9 int bai = 0; 10 int sxnum = 0; 11 for (int i = 100; i < 1000; i++){ 12 ge = i % 10; 13 shi = (i / 10) % 10; 14 bai = i / 100; 15 if(i == ge*ge*ge + shi*shi*shi + bai*bai*bai){ 16 sxnum = i; 17 System.out.println("sxnum = " + sxnum); 18 } 19 } 20 21 } 22 23 }
sxnum = 153
sxnum = 370
sxnum = 371
sxnum = 407
时间: 2024-11-03 22:02:30