|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Assume burgers come in packages of 10, and burger buns come in packages of 8. Write a Python program that calculates the number of packages of burgers and the number of packages of burger buns needed for a cookout, with the minimum amount of leftovers. The program should ask the user for the number of people attending the cookout and the number of burgers each person will be given. The program should display the following details:
• The minimum number of packages of burgers required
• The minimum number of packages of burger buns required
• The number of burgers that will be left over
• The number of burger buns that will be left over
假设汉堡包是10个一包,汉堡胚是8个一包。编写一个Python程序,计算一次野餐所需的汉堡包的数量和汉堡胚的数量。需要多少包汉堡和多少个汉堡胚使得剩菜的数量最少。该程序应要求用户提供参加野餐的人数以及每个人将得到的汉堡包数量。该程序应显示以下细节。
- 所需的汉堡包的最少包数
- 所需汉堡胚的最少包装数量
- 将会剩下的汉堡的数量
- 将会剩余的汉堡包的数量 |
|