#include<bits/stdc++.h>
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
using namespace std;
int isPrime(long long x){
int cnt=0;
int sqr = sqrt(x);
ff(j,2,sqr+1){
if(x%j==0)
cnt++;
while(x%j==0)
x/=j;
}
if(x!=1)
cnt++;
return cnt;
}
int main()
{
int cse=0,cnt=0,flg=0;
long long num;
while(cin>>num){
if(num==0)
break;
cnt=isPrime(num);
cout<<num<<" : "<<cnt<<endl;
cnt=0;
}
return 0;
}
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
using namespace std;
int isPrime(long long x){
int cnt=0;
int sqr = sqrt(x);
ff(j,2,sqr+1){
if(x%j==0)
cnt++;
while(x%j==0)
x/=j;
}
if(x!=1)
cnt++;
return cnt;
}
int main()
{
int cse=0,cnt=0,flg=0;
long long num;
while(cin>>num){
if(num==0)
break;
cnt=isPrime(num);
cout<<num<<" : "<<cnt<<endl;
cnt=0;
}
return 0;
}
No comments:
Post a Comment