include
main(){
int i1,i2;
for(i1=3;i1<98;i1++){
for(i2=2;i2
printf("%d ",i1);
}
}
}
}
#include
#include
main(){
int n = 100;
int i,j,m;
int flg = 0;
printf("素数如下:\n");
for(i=2; i<=n; i++)
{
flg = 1;
j = 2;
m = sqrt(i);
while(j
if(i%j == 0)
flg = 0;
j++;
}
if(flg == 1)
printf(" %d |", i);
}
}
#include
int main ( void )
{
int i, j, p, prime [ 100 ];
p = 0;
prime [ p ++ ] = 2;
for ( i = 2; i < 101; i ++ )
{
for ( j = 0; j < p; j ++ )
if ( !(i % prime [ j ]) ) break;
if ( j >= p )
prime [ p ++ ] = i;
}
for ( i = 0; i < p; i ++ )
printf ( "%d ", prime [ i ] );
return 0;
}
#include "stdio.h"
#include "stdlib.h"
void main(){
int i1,i2;
for(i1=3;i1<98;i1++){
int bFlag = 0;
for(i2=2;i2
bFlag = 1;
}
}
if(bFlag == 0) printf("%d\n",i1);
}
}
#include
main()
{
int m,k,i,n=0;
for(m=1;m<100;m+=2)
{
k=sqrt(m);
for(i=2;i<=k;i++)
if(m%i==0)break;
if(i>=k+1)
{ printf("%d ",m);
n++;
}
}
}