标签:
package hello;
import java.util.Scanner;
public class hello {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int x = in.nextInt();
boolean isPrime = true;
for(int i=2; i<x; i++){
if(x%i == 0){
isPrime = false;
}
}
if(isPrime){
System.out.println(x+"素数");
}
}
}
标签:
原文地址:http://www.cnblogs.com/jy627625/p/5722568.html