Is it okay?

Though I know that it's the time I tell my decision to my co-general manager,I'm hestating ,why?Maybe I feel it is a bit wrong,maybe I  ...but I must do it,more early more good.

Undoubtably,I'll leave here.it's my terminal idea.I can't stay here for more long,or else I'll work in this company in the later days. 

The new project is beginning next week.It's a pity that I have to leave.Here, sarary and lodgings is ok,also the workmates.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Sure! Here's a sample code in Python that can create a sandwich within a given calorie range: ```python import random # sandwich ingredients and their associated calories ingredients = { "Bread": 100, "Ham": 150, "Lettuce": 10, "Tomato": 20, "Mayonnaise": 50, "Cheese": 120 } # prompt user for calorie range min_calories = int(input("Enter minimum calories: ")) max_calories = int(input("Enter maximum calories: ")) # calculate the minimum and maximum calories for the sandwich min_sandwich_calories = 2 * ingredients["Bread"] + min(ingredients.values()) * 2 max_sandwich_calories = 2 * ingredients["Bread"] + max(ingredients.values()) * 2 # check if the calorie range is valid if max_calories < min_sandwich_calories: print("Sorry, it is impossible to create a sandwich within the given calorie range.") else: # create the sandwich sandwich = ["Bread", "Bread"] sandwich_calories = 2 * ingredients["Bread"] while sandwich_calories < min_calories: # add random ingredient ingredient = random.choice(list(ingredients.keys())) sandwich.append(ingredient) sandwich_calories += ingredients[ingredient] while sandwich_calories <= max_calories: # add random ingredient ingredient = random.choice(list(ingredients.keys())) # check if the ingredient is the same as the previous one if len(sandwich) >= 3 and ingredient == sandwich[-2]: continue sandwich.append(ingredient) sandwich_calories += ingredients[ingredient] # check if the sandwich is already at the maximum calorie limit if sandwich_calories == max_sandwich_calories: break # add the last slice of bread sandwich.append("Bread") # print the sandwich and its total calories print("Your sandwich:", sandwich) print("Total calories:", sandwich_calories) ``` This program first prompts the user for the minimum and maximum calorie range. It then calculates the minimum and maximum calories for the sandwich based on the ingredients and the requirement of having two slices of bread at the start and end of the sandwich. If the maximum calorie range is less than the minimum calories required for the sandwich, the program will print an error message. Otherwise, it will create the sandwich by randomly selecting ingredients that meet the calorie range restriction and the requirement of not having adjacent identical ingredients. Finally, the program prints the sandwich and its total calories.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值