import sys, math
def countDivisorAmount(num):
sqrt = int(math.sqrt(num)) # 平方根向下取整
amount = 0
for i in range(1, sqrt+1):
if num % i == 0:
amount += 2
if num == sqrt * sqrt:
amount -= 1
return amount
newCase = True
for line in sys.stdin:
if newCase:
N = int(line)
newCase = False
else:
newCase = True
ls = list(map(int,line.strip().split()))
for num in ls:
print(countDivisorAmount(num))
KY3 约数的个数
最新推荐文章于 2024-11-05 21:58:11 发布