package com.lu;
import java.util.Scanner;
public class Text5 {//找素数
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入范围找素数");
primeNumber(input.nextInt(), input.nextInt());
}
public static void primeNumber(int a,int b){//找素数
for (int i = a; i <= b; i++) {
int count = 0;
for (int j = 2; j <= i/2; j++) {
if (i%j==0){
count++;
break;
}
}
if (count!=1){
System.out.println(i);
}
}
}
}
01-22
320
01-27
1357
03-08