加拿大最南方的城市:QBASIC高手请赐教

来源:百度文库 编辑:神马品牌网 时间:2024/05/06 01:21:11
某班开联欢会,需买瓜子、花生和糖果,已知瓜子2元/包、花生3元/包、糖果4元/包,计算用N元正好买M包东西的采购方法

input "money =";n
input "how many =";m
for a=1 to m
for b=1 to m-x
c=m-a-b
if n=2*a+3*b+4*c then
print "a=";a,"b=";b,"c=";c
end if
next
next