package scanner; public class zhengChu1 { public static void main(String[] args) { //50以内打印质数 System.out.println("50以内的质数有:"); outer:for (int j=1;j<50;j++){ for (int x=2;x<j/2;x++){ if (j%x==0) { continue outer; } System.out.print(j+"\t"); } } } }
package scanner; public class zhengChu1 { public static void main(String[] args) { //50以内打印质数 System.out.println("50以内的质数有:"); outer:for (int j=1;j<50;j++){ for (int x=2;x<j/2;x++){ if (j%x==0) { continue outer; } System.out.print(j+"\t"); } } } }