4-10

#include<stdio.h>

#include<math.h>

int main(void)

{

         int count,i,m,n;

 

         count=0;

         for(m=2;m<=100;m++){

                   n=sqrt(m);

                   for(i=2;i<=n;i++)

                            if(m%i==0)

                                     break;

                            if(i>n){

                                     printf("%6d",m);

                                     count++;

                                     if(count%10==0)

                                               printf("\n");

                            }

         }

         printf("\n");

}

posted @ 2013-10-04 18:27  zhaoyang16  阅读(102)  评论(0编辑  收藏  举报