写一个while循环并计数,试试如下python代码:
x=100000 n=0 while x>=1000: if x>50000: x-=0.05*x n+=1 if x<=50000: x-=1000 n+=1 print(n)
如有帮助,请点击我回答右上方采纳按钮予以采纳~~