GetPrime


public class GetPrime {

public static void main(String[] args) {
// TODO 自动生成的方法存根
int a,b = 0,c = 0;
a=Integer.parseInt(args[0]);
a=Integer.parseInt(args[1]);
a=Integer.parseInt(args[2]);
boolean flag;
int m,p,count=0;
for(m=a;m<= b;m++){
flag=true;
for(p=2;p<=m/2;p++)
if(m%p==0){
flag=false;
break;
}
if(flag){
System.out.print(m+" ");
count++;
if(count% c==0)
System.out.println();
}
}
}

}

原文地址:https://www.cnblogs.com/wlp1115/p/6561815.html