#include <iostream>
#include <cstdio>
#include <math.h>
#define max 1000000
using namespace std;
long long ary[max];
long long seive[max];
int sve(){
long long i,j,count=1;
for (i=3;i<=sqrt(max);i+=2){
if(ary[i]==0){
for(j=i*i;j<=max;j+=i){
ary[j]=1;
}
}
}
seive[1]=2;
for(i=3;i<=max;i+=2){
if(ary[i]==0){
count++;
seive[count]=i;
}
}
}
int main (){
long long num,i,c;
sve();
while(scanf("%lld",&num)==1){
if(num==0) break;
c=0;
if(num==1){
cout<<num<<" : "<<1<<endl;
}
else{
for(i=1;i<=(num)/2;i++){
if(seive[i]>num) break;
if(num%seive[i]==0){
c++;
}
}
cout<<num<<" : "<<c<<endl;
}
}
return 0;
}
#include <cstdio>
#include <math.h>
#define max 1000000
using namespace std;
long long ary[max];
long long seive[max];
int sve(){
long long i,j,count=1;
for (i=3;i<=sqrt(max);i+=2){
if(ary[i]==0){
for(j=i*i;j<=max;j+=i){
ary[j]=1;
}
}
}
seive[1]=2;
for(i=3;i<=max;i+=2){
if(ary[i]==0){
count++;
seive[count]=i;
}
}
}
int main (){
long long num,i,c;
sve();
while(scanf("%lld",&num)==1){
if(num==0) break;
c=0;
if(num==1){
cout<<num<<" : "<<1<<endl;
}
else{
for(i=1;i<=(num)/2;i++){
if(seive[i]>num) break;
if(num%seive[i]==0){
c++;
}
}
cout<<num<<" : "<<c<<endl;
}
}
return 0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন