C语言实现如下:include<stdio.h>#include<math.h>#include<stdlib.h>void main(){int n,i,b=1;scanf("%d",&n);if (n==1) {printf("1既不是质数,也不是合数\n");exit(0);}for(i=2;i<=(int)sqrt(n);i++){if (n%i==0) {b=0;break;}}if (b) printf("%d是质数\n"...