package com.alibaba.demo05;
public class lianxi3 {
public static void main(String[] args) {
int count = 0;
for(int i = 1;i<=100;i++){
boolean boo = true;
for(int j=2;j<i;j++){
if(i%j==0){
boo = false;
}
}
if(boo){
count++;
System.out.printf("%5d",i);
if(count%10==0){
System.out.println();
}
}
}
}
}
输出100以内的所有质数
最新推荐文章于 2025-12-02 18:57:44 发布
3982

被折叠的 条评论
为什么被折叠?



