cheng1107


私信TA

用户名:chengrui1990

访问量:4882

签 名:

学习走起

等  级
排  名 15948
经  验 773
参赛次数 0
文章发表 9
年  龄 27
在职情况 在职
学  校 理工大学
专  业

  自我简介:

解题思路:





注意事项:





参考代码:

#include <stdio.h>

int func1(int a)

{

    int i,t=0;

for(i=2;i<a;i++)

{

if(a%i==0)

{

  t++;

}

else

{

 t;

}

}

if(t>0)

{

printf("not prime\n");

}

else

{

printf("prime\n");

}

}

int main()

{

int a;

if((scanf("%d",&a) == 1)&&((a > 1)||(a < 65535)))

{

func1(a);

}

else

{

printf("the type of input is wrong\n");

printf("please input again!\n");

}

return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区