输入区间求区间内的素数
#include"stdio.h"
main()
{int a,b,x,y,n=0;
printf("请输入数的区间:");
scanf("%d%d",&x,&y);
for(a=x;a<=y;a++)
{for(b=2;b<=a-1;b++)
if(a%b==0)break;
if(a==b)
{printf("%5d",a);
n++;
if(n%5==0 ) printf("\n");
}
}
printf(“\nThe total is %d\n”,n);
getch();
}