标签:peime number
//prime number #include<iostream> using namespace std; int main() { bool isprime; cout<<"Prime number: "<<endl; for(int i = 3;i <= 100;i++) { isprime = true; for(int j = 2;j < i;j++) { if(i % j == 0) isprime = false; } if(isprime) cout<<i<<" is prime number."<<endl; } return 0; }
peime number.采用bool标志位判定!
标签:peime number
原文地址:http://9320314.blog.51cto.com/9310314/1544917