• 2022-06-19 问题

    已知有n个数据进行排序,下面能实现排序的是 A: data=[34,5,-6,12,87,29]data.sort() B: data=[34,5,-6,12,87,29]n=len(data)od=[]whileiwhilejifdata[j]>data[j+1]:t=data[j]data[j]=data[j+1]data[j+1]=tj+=1i+=1 C: data=[34,5,-6,12,87,29]n=len(data)i=0j=0whileiwhilejifdata[j]>data[j+1]:t=data[j]data[j]=data[j+1]data[j+1]=tj+=1i+=1print(data) D: data=[34,5,-6,12,87,29]n=len(data)i=0j=0whileiwhilejifdata[i]>data[j]:t=data[i]data[i]=data[j]data[j]=tj+=1i+=1

    已知有n个数据进行排序,下面能实现排序的是 A: data=[34,5,-6,12,87,29]data.sort() B: data=[34,5,-6,12,87,29]n=len(data)od=[]whileiwhilejifdata[j]>data[j+1]:t=data[j]data[j]=data[j+1]data[j+1]=tj+=1i+=1 C: data=[34,5,-6,12,87,29]n=len(data)i=0j=0whileiwhilejifdata[j]>data[j+1]:t=data[j]data[j]=data[j+1]data[j+1]=tj+=1i+=1print(data) D: data=[34,5,-6,12,87,29]n=len(data)i=0j=0whileiwhilejifdata[i]>data[j]:t=data[i]data[i]=data[j]data[j]=tj+=1i+=1

  • 1