日期:2014-05-20 浏览次数:20827 次
package com.cd; //代码运行没问题,查看你的jdk 环境变量设置 //cmd下 运行java看看 public class sushu{ public static void main(String args[]){//最好养成习惯args int i,j,m=1; for (i=2;i<100;i++){ for(j=2;j<=i/2;j++) if (i%j==0) m=0; if(m==1) System.out.println(i); m=1; } } } //2 //3 //5 //7 //11 //13 //17 //19 //23 //29 //31 //37 //41 //43 //47 //53 //59 //61 //67 //71 //73 //79 //83 //89 //97