while True:
try:
a,res=int(input()),1
count=2
while count**2<a:
while a%count==0:
res+=1
a=a/count
count+=1
print(res)
except:
break
上述代码有问题,经过@牛客3246208号 更正后:
a, res = int(input()), 0
count = 2
while count**2 <= a:
while a % count == 0:
res += 1
a = a / count
count += 1
if a==1:
break
if a>1:
res+=1
print(res)