#include<iostream> using namespace std; int Prim( int n) { int i=2,cnt=0; while(n>0&&n>=i) { if(n%i==0) { cnt++; while(n%i==0) { n=n/i; } } i++; } return cnt; } int main() { int n; while(cin>>n) { cout<<Prim(n)<<endl; } return 0; }
#include<iostream> using namespace std; int Prim( int n) { int i=2,cnt=0; while(n>0&&n>=i) { if(n%i==0) { cnt++; while(n%i==0) { n=n/i; } } i++; } return cnt; } int main() { int n; while(cin>>n) { cout<<Prim(n)<<endl; } return 0; }
转载于:https://www.cnblogs.com/calmwithdream/p/5559339.html