class Demo22 {
public static void main(String[] args) {
int count = 1;//数量统计
int Zhishu[]=new int[100];//奇数数组
Zhishu[0]=2;
f:for (int a=2;a<100 ;a++ ) {//被除数循环
for (int b=0;b<count ;b++ ){//除数循环
if (a%Zhishu[b] == 0){
continue f;
}
}
System.out.print(a+",");
Zhishu[count++]=a;
}
System.out.println("\n"+count);
}
}
|
|