zoukankan      html  css  js  c++  java
  • 100以内的素数

    public class test

                public static void main(String[] args)

               {  

                        int i,n,k=0;     

                        for (n = 3; n<=100; n++)

                        {        i=2;         

                                while (i<n)

                               {   if (n%i==0)  break;     i++;           }
                               if (i==n)

                              {    

                                 k++;   System.out.print(i+ " ");   

                                 if (k %6==0)  System.out.println();     

                              }  

                        }

             }

    }

  • 相关阅读:
    1-4-04:奇偶ASCII值判断
    1-4-03:奇偶数判断
    1-4-02:输出绝对值
    1-4-01:判断数正负
    1-3-20:计算2的幂
    1-3-19:A*B问题
    1-3-18:计算三角形面积
    Use PIVOT Table in SQL Server
    Pivoting DataTable Simplified
    Pivot Methods 行列转换
  • 原文地址:https://www.cnblogs.com/kexiaole/p/6593912.html
Copyright © 2011-2022 走看看