已经发送
import java.util.Scanner;
public class PrimeNumber {
public static void main(String[] args) {
System.out.println("input numbers:");
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int flag = 1;
for (int i = 2; i < (num / 2); i++) {
if (num % i != 0) {
flag = 1;
} else {
flag = 0;
}
}
if (flag == 1) {
System.out.println(num + "是质素!!");
} else {
System.out.println(num + "不是质素!!");
}
}
}