def print2MaxofNDigits(n):
if n<=0:
return
num=['0']*n
for i in range(10):
num[0]=str(i)
recursive(num,n,0)
print(num)
#递归出数字排列
def recursive(number,length,index):
if index==length-1:
printNumber(number)
return
for i in range(10):
number[index+1]=str(i)
recursive(number,length,index+1)
#打印
def printNumber(n):
numb=''.join(n)
for i in range(len(numb)):
if numb[i]!='0':
print(numb[i:])
break