该程序运行的部分界面如下图所示,请在程序划线处填入合适的代码。
ore = int(input("请输入矿石质量:"))
weights = [50,20,10,5,2,1] #砝码规格
#初始化所需的各规格砝码数量
num = [0]*len(weights) #生成列表num为[0,0,0,…],列表中为len(weights)个0
res = "所需的砝码:"
while ore > 0:
num[i] = ore // weights[i]
i += 1
for i in range(len(num)):
if :
res = res + str(weights[i]) + "g:" + str(num[i]) + "个;"
print(res[:-1])