#14574: c++


elvisliu (方塊)

學校 : 臺北市私立延平高級中學
編號 : 69054
來源 : [203.72.178.252]
最後登入時間 :
2018-12-19 17:05:19
d120. 10699 - Count the factors -- UVa10699 | From: [203.72.178.252] | 發表日期 : 2018-07-24 14:26

#include <bits/stdc++.h>
using namespace std ;
int main() {
int n,p;
while(cin>>n,n){
cout<<n<<" : ";
p=0;
for(int i=2; n>1; i+=(i==2?1:2))
{
if(n%i) continue;
p++;
while(n%i==0) n/=i;
}
cout<<p<<endl;
}
}

 
ZeroJudge Forum