标签:style mat lse nbsp turn scanf 素数 include ret
1 #include<stdio.h> 2 #include<math.h> 3 int main() 4 { 5 int n,i; 6 scanf("%d",&n); 7 8 for(i=2.0;i<sqrt(n);i++) 9 { 10 if(n%i == 0) 11 { 12 break; 13 } 14 } 15 if(i<sqrt(n)) 16 { 17 printf("不是素数\n"); 18 } 19 else 20 { 21 printf("是素数\n"); 22 } 23 return 0; 24 }
标签:style mat lse nbsp turn scanf 素数 include ret
原文地址:https://www.cnblogs.com/rookieclimber/p/10786249.html