n = int(input())
count1=0
count2=0
temp = n
while temp%4 == 0:
temp //= 4
count1+=1
temp = n
while temp%7 == 0:
temp //= 7
count2+=1
print("{} {}".format(count1,count2))
注意不能用“/=”,这会自动转化为float类型,在计算很大的数据时会有问题。
n = int(input())
count1=0
count2=0
temp = n
while temp%4 == 0:
temp //= 4
count1+=1
temp = n
while temp%7 == 0:
temp //= 7
count2+=1
print("{} {}".format(count1,count2))
注意不能用“/=”,这会自动转化为float类型,在计算很大的数据时会有问题。