请回答下列问题:
def data_sort(a):
for i in range(len(a)):
for j in :
if ① :
a[j], a[j+1] = a[j+1], a[j]
①划线处填入的语句为,可实现上述功能。
②若将加框处语句写错为 range(i,len(a)-1),则下列 4 组数据中,若列表a 的值为(单选,填字母)不能测试出问题。
A. [['A1',100,30],['A2',120,30],['A3',110,30],['A4',140,30],['A5',130,30]]
B. [['A1',120,30],['A2',110,30],['A3',100,30],['A4',130,30],['A5',140,30]]
C. [['A1',110,30],['A2',140,30],['A3',130,30],['A4',100,30],['A5',120,30]]
D. [['A1',110,30],['A2',120,30],['A3',130,30],['A4',140,30],['A5',100,30]]
def huan(n):
#将分钟转换为时间AA:BB 格式,返回值为字符串,代码略#读取文件中的信息,并存储在列表 order 中,代码略data_sort(order)
n=int(input("机器数量:")) for i in range(len(order)):
order[i].append(-1)#order[i]追加一个元素-1 mach = [-1] * n
num, wait = 0, 0
for i in range(len(order)):
k = -1
time = -1
for j in:
t1 = mach[j]
if k == -1:
k = j
time = order[t1][1]+order[t1][2]
else:
t2 = mach[k]
if order[t1][1]+order[t1][2]<order[t2][1]+order[t2][2]:
k = j
time = order[t1][1]+order[t1][2]
if k == -1 or num < n and:
mach[num] = i
num += 1
else:
order[i][3] = mach[k]
mach[k] = i
if time > order[i][1]:
wait += time-order[i][1]
order[i][1] = time if num < n:
print("只需开启"+str(num)+"台机器") else:
print(str(n)+"台机器全部开启,订单平均等待"+str(round(wait/len(order),2))+"min") for i in range(num):
print('第'+str(i+1)+'台机器:')
p = mach[i]
ans = ''
while p!=-1:
ans = order[p][0]+':'+huan(order[p][1])+'~'+huan(order[p][1]+order[p][2])+',' + ans
p =
print(ans[:-1])