代码:
num = int(raw_input("please input a data: "))
count = num/2
while count>0:
if num%count == 0:
print count, 'is the largest factor of', num
break;
count -=1
运行结果:
>>> ================================ RESTART ================================
>>>
please input a data: 51
17 is the largest factor of 51