package struct; public class BreakDemo01 { public static void main(String[] args) { int i = 0; while (i<=100){ i++; System.out.println(i); if (i == 10){ break; } } } }
package struct; public class ConniuneDemo01 { public static void main(String[] args) { int i = 0; while (i<100){ i++; if (i%10 == 0){ System.out.println(); continue; } System.out.print(i); } } }
package struct; public class LableDemo01 { public static void main(String[] args) { //打印101-150之间所有的质数 outer:for (int i=101;i<150;i++){ for (int j=2;j<i/2;j++){ if (i%j==0){ continue outer; } } System.out.print(i+"\t"); } } }