程序输出结果是否正确。
python 2.7版:
#!/user/bin/env/ python
# -*- coding: utf-8 -*-
num = raw_input('please input a num:')
num = int(num)
flag = 0
for i in range(1,num/2+1):
sum = 0
temp = i
while(sum < num):
sum += temp
temp = temp + 1
if(sum == num):
for j in range(i,temp):
flag = 1
print j,
print ''
if(flag == 0):
print ("None")