//打印1~100的素数,并求出他们的和!
public class ss {
public static void main(String[] args) {
int s=0;
System.out.print("1 ");
for (int i=2;i<101;i=i+1) {
int a=0;
for (int j=2;j<101;j=j+1) {
if (i%j==0) {
a++;
s+=i;
}
}
if (a==1) {
System.out.print( i + " " );
}
}
System.out.println(" ");
System.out.println("1-100之间素数的和为"+s);
}
}

〖ΦγЙ┅给梦一把梯子,现实与梦想之间的距离即可忽略,不可跨越的迢迢银河举步便可迈过Й┅Φ〗