除了这3个数都选0个外共有239种组合,代码(缩进见图):c=0for i in range(5):for j in range(6):for k in range(8):r='1.25+'*i+'2.5+'*j+'3+'*kif r:c+=1print(r[:-1],'=',sum((1.25*i,2.5*j,3*k)),sep='')print(f'共{c}种组合')
除了这3个数都选0个外共有239种组合,代码(缩进见图):c=0for i in range(5):for j in range(6):for k in range(8):r='1.25+'*i+'2.5+'*j+'3+'*kif r:c+=1print(r[:-1],'=',sum((1.25*i,2.5*j,3*k)),sep='')print(f'共{c}种组合')