//1~100内所有素数的和
public class Exercise3 {
public static void main(String[] args) {
int i,j;
int hh=0;
for (i=1;i<=100;i++) {
for (j=2;j<i;j++) {
if (i%j==0) {
break;
}
}
if(i==j) {
System.out.print(i+"\t");
hh=hh+1;
if (hh%5==0) {
System.out.print("\n");
}
}
}
}
}
1~100内所有素数的和
猜你喜欢
转载自blog.csdn.net/qq_31395031/article/details/79744882
今日推荐
周排行