You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
C/2.判断素数.cpp

19 lines
269 B

#include<stdio.h>
int main()
{
int a=0;//<2F>ж<EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD>Ӹ<EFBFBD><D3B8><EFBFBD>
int p;
int i;
scanf("%d",&p);
for(i=2;i<p;i++)
{
if(p%i==0)
a++;
}
if(a==0)
printf("%d is a prime\n",p);
else
printf("%d is not a prime\n",p);
return 0;
}