#include <stdio.h>
#include<math.h>
int main()
{
int i, j;
printf("请输入一个数:");
scanf_s("%d", &i);
if(i==1)
printf("%d不是素数", i);
if (i == 2)
printf("%d是素数", i);
for (j =2; j <=i-1; j++)
{
if (i % j == 0)
{
printf("%d不是素数", i);
break;
}
else
printf("%d是素数", i);
break;
}
return 0;
}
标签:main,判断,int,是否是,break,素数,printf,include From: https://blog.51cto.com/u_16336886/8433533