C语言小知识: 1.%d可以设置左右对齐问题.如 %4d 向右对齐4格为一个单位
2. 关于10^x的问题 可表示为 1e-10 1*10^(-10) 4e6 4*10^6
/* Note:Your choice is C IDE 函数素数问题*/
#include “stdio.h”
int main()
{
int x,t,y;
for(x=2,t=1;x<=100;x++)
{ t=1;
for(y=2;y<x;y++)
if(x%y==0)
{ t=0;break;}
// else t=1;
if(t==1)
printf("%d ",x);
}
return 0;
}
也可设置一个标志标量flog