#include<stdio.h>
int s(int x)
{
int i,y;
for (i=2;i<x;i++)//i应该从2开始判断,不能%0
if(x%i==0)
{
y=0;
break;//一旦不是素数,就应该跳出当前循环
}
else
y=1;
return y;
}
main()
{
int x;
scanf("%d",&x);
if(s(x)==1)//这里的条件应该是返回值==1
printf("%d is a prime\n",x);
else
printf("%d is not a prime\n",x);
return 0;
}