1个回答
展开全部
#include "stdio.h"
方法一:
main()
{
int x,m;
scanf("%d",&x);
for(m=2;m<=x-1;m++)
if(x%m==0)break;
if(m>x-1)printf("%d is susu\n",x);
else printf("%d not susu\n",x);
}
方法二:函数调用
#include "stdio.h"
main()
{
int x;
scanf("%d",&x);
sushu(x);
}
sushu(int n)
{ int m;
for(m=2;m<=n-1;m++)
if(n%m==0)break;
if(m>n-1)printf("%d is sushu\n",n);
else printf("%d not sushu\n",n);
}
方法一:
main()
{
int x,m;
scanf("%d",&x);
for(m=2;m<=x-1;m++)
if(x%m==0)break;
if(m>x-1)printf("%d is susu\n",x);
else printf("%d not susu\n",x);
}
方法二:函数调用
#include "stdio.h"
main()
{
int x;
scanf("%d",&x);
sushu(x);
}
sushu(int n)
{ int m;
for(m=2;m<=n-1;m++)
if(n%m==0)break;
if(m>n-1)printf("%d is sushu\n",n);
else printf("%d not sushu\n",n);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询