11.05日常

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

猜你喜欢

转载自blog.csdn.net/qq_45688164/article/details/102924805
今日推荐