标签:image false script math block include logs source main
1 #include<iostream> 2 #include<cmath> 3 using namespace std; 4 int Isprime(int n) 5 { 6 int flag=1; 7 if(n<=1) 8 {return 0;} 9 for(int i=2;i<n;i++) 10 { 11 if(n%i==0) 12 {flag=0; 13 break;} 14 } 15 16 return flag; 17 } 18 bool Ischun_Prime(int n) 19 { 20 int count=0; 21 22 for(int i=4;i>=1;i--) 23 { 24 n%=(int)pow(10,i); 25 26 if(Isprime(n)) 27 28 {count++;} 29 30 31 } 32 33 if(count==4) 34 return true; 35 else 36 return false; 37 } 38 int main() 39 { 40 for(int i=1000;i<3000;i++) 41 { 42 if(Ischun_Prime(i)) 43 {cout<<i<<endl;} 44 } 45 return 0; 46 }
标签:image false script math block include logs source main
原文地址:http://www.cnblogs.com/LHR-HY/p/6360156.html