#include <stdio.h> #include<math.h> void main(){ int m,k,i,loop=1; scanf("%d",&m); k=sqrt(m);//下转型? for(i=2;loop&&i<=k;i++){ if(m%i==0) loop=0; } if(loop) printf("%d is a prime!\n",m); else primtf("%d is't a prime!\n",m); }