JAVA programming ------------- prime number less than 27,100

. 1  Package FushiExam;
 2  
. 3  public  class Text_27 {
 . 4  
. 5      public  static  void main (String [] args) {
 . 6          // find the prime numbers less than 100 
. 7          System.out.println ( "prime number within the output 100:" );
 . 8          for ( int I = 2; I <= 100; I ++ ) {
 . 9              int Tage = 0 ;
 10              for ( int J = 2; J <= the Math.sqrt (I); J ++ ) {
 . 11                  IF (I J == 0% )
 12 is                      Tage =. 1 ;
 13 is             }
14             if(tage==0)
15                 System.out.println(i);
16         }
17 
18     }
19 
20 }

 

Guess you like

Origin www.cnblogs.com/fmust/p/12508744.html