在pycharm上运行没有发现问题 求指点 代码如下:
def f(listx, x):
od = 0
op = len(listx)
while x != 0 and od < op-1:
if listx[od] > listx[od+1]:
if od == 0 and listx[od+1] == 0:
od += 1
continue
listx.pop(od)
x = x-1
op = op-1
od = 0
continue
od += 1
return x
m = input()
n = int(input())
list1 = list(m)
list1 = [int(i)for i in list1]
rest = len(list1)
n = f(list1, n)
list1 = [str(i)for i in list1]
n = int(n)
if n == 0:
c = ''.join(list1)
c.strip()
print(c)
else:
y = len(list1)-n
if y == 1 and list1[1] == 0:
print('0')
else:
list1[y:] = ' '
c = ''.join(list1)
c.strip()
print(c)