java - while 16
package com.demo.test;
public class whileDemo {
public static void main(String[] args) {
// 水仙花案例
int i = 100;
while (i<=999){
int individual = i % 10;
int ten = i / 10 % 10;
int hundred = i / 100;
if (individual*individual*individual + ten*ten*ten+hundred*hundred*hundred == i){
System.out.println(i);
}
// i++不能遗漏
i++;
}
int j = 1;
do {
System.out.println("666");
j++;
}while (j<=5);
}
}
代码改变了我们,也改变了世界