#include<stdio.h>
int main()
{
int n,i;
printf(“please enter a integer number,n=?”);
scanf("%d",&n);
for(i=2;i<=n-1;i++)
if(n%i==0)
break;
if(i<n)
printf("%d is not a prime number.\n",n);
else
printf("%d is a prime number.\n",n);
return 0;
}
5.8 循环程序举例 例5.9
最新推荐文章于 2021-12-17 12:24:26 发布