package practice.homework; public class SuShu { public static void main(String[] args) { int i; int j; int is_prime; for(i = 100;i <= 200; i++) { is_prime = 1; //is_prime=1表示为素数,为0则不是素数 for(j = 2;j <= i/2; j++) { if(i%j==0) { is_prime = 0; ...
打印100~200之间的素数public class Prime { public static void main(String args[]) { for (int i = 101; i < 201; i++) { boolean mark = true; for (int k = 2; 2 * k - 1 < i; k++) { if (i % k == 0) …
public static Boolean Prime(int n) { for (int i = 2; i < Math.sqrt(n); i++) { if (n % i == 0) { return false;} } return true;} public static void main(String[] args) { System.out.print("素数有:");for(int j= 100;j<=200;j++){ if(Prime(j)){ System...