package Four;
/*
* 素数
* 题目描述
* 输入一个整数n(2-10000)要求输出所有1-这个整数之间
* 不包括1和这个整数,个位为1的素数,若没有则输出-1;
* */
import java.util.Scanner;
public class PrimeNumber2 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("请输入数字n:");
int n = scan.nextInt();
int count =0;
for (int i = 2; i <= n; i++) {
boolean isPrime = true;
for (int j = 2; j < i; j++) {
if (i % j == 0) {
isPrime = false;
break;
}
}
if (isPrime) {
if (i % 10 == 1) {
count++;
System.out.println(i + "是素数");
}
} else {
continue;
}
}
if(count==0){
System.out.println(-1);
}
}
}