标签:mat style span for 质数 else lag include stdio.h
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 5 int isit(int num) 6 { 7 int i; 8 int flag = 1;//表述为素数 9 if(num==2) 10 { 11 return 1; 12 }else if(num==3) 13 { 14 return 1; 15 }else if(num<=1) 16 { 17 return 0; 18 }else 19 { 20 for(i=2;i<(int)(sqrt((int)num))+1;i++) 21 { 22 if(num%i==0) 23 { 24 flag = 0; 25 break; 26 } 27 } 28 return flag; 29 } 30 }
标签:mat style span for 质数 else lag include stdio.h
原文地址:http://www.cnblogs.com/lanjianhappy/p/6044078.html