1092: 素数表(函数专题)
import java.util.Scanner;
public class Main {
public static int prime(int n)
{
if(n<2) return 0;
for(int i=2;i<=Math.sqrt(n);i++)
if(n%i==0) return 0;
return 1;
}
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int a=cin.nextInt();
int b=cin.nextInt();
for(int i=a;i<=b;i++)
{
if(prime(i)==1)
System.out.printf("%d ",i);
}
}
}