#40. 食谱配料条件修改

    ID: 40 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatMap-1gesp1条件结构

食谱配料条件修改

Food Topping Modification

Background

In a busy kitchen, chefs are preparing various delicious dishes. They use a special recipe system to manage the toppings for each food item. Now, they need to make some adjustments to specific toppings.

Problem Description

Given a map of food keys and their topping values, modify and return the map as follows:

  1. If the key "ice cream" has a value, set that as the value for the key "yogurt" also.
  2. If the key "spinach" has a value, change that value to "nuts".

Input Format

Input is given from standard input in the following format.

A map representing food keys and their topping values.

Output Format

Output is printed to standard output in the following format.

The modified map.

Sample

"ice cream": "cherry"
{"yogurt": "cherry\