求助C++用while结构判断素数怎么办?
#include<stdio.h>#include<math.h>)
void main()
{
int a,i,b;
printf("please enter a integer number:");
scanf("%d",&a);
i=2;
b=(int)sqrt(m)
while(i<b;i++)
{
a%i==0;
}
if(i>b)printf("%d is a prime number.\n",a);
else printf("%d is not a prime number.\n",a);
}