1 public static void main(String[] args) { 2 int j = 0, k; 3 for (int i = 10000;; i++) { 4 for (k = 2; i % k != 0 && k * k < i; k++) 5 ; 6 if (k * k > i) { 7 j++; 8 System.out.println(i + "\t"); 9 if (j >= 10) { 10 break; 11 } 12 } 13 } 14 }
1 public static void main(String[] args) { 2 int j = 0, k; 3 for (int i = 10000;; i++) { 4 for (k = 2; i % k != 0 && k * k < i; k++) 5 ; 6 if (k * k > i) { 7 j++; 8 System.out.println(i + "\t"); 9 if (j >= 10) { 10 break; 11 } 12 } 13 } 14 }
转载于:https://www.cnblogs.com/taoist123/p/10136349.html