Froggy Squad Проблем със задачи Mid exam Programming Fundamentals Mid Exam - 30 June 2019 Group 2
Привет ,може ли решение на задачата описана по до долу :
Create a program that helps you keep track of the frogs that are on the riverside. Because you are an extreme animal lover, you also name them. You will receive the names of the frogs that are already on the riverside on a single line, separated by a single space in the following format:
"{frog1} {frog2} {frog3}… {frogn}"
Then you will receive commands that describe their action. There are five possible commands:
- "Join {name}":
- A frog comes on the riverside and you need to add it in the end of your collection. Frog names will never repeat.
- "Jump {name} {index}"
- A frog jumps out of the water and joins the other frogs. You need to add it in your collection on the given index, if the index exists.
- "Dive {index}":
- The frog on the given index has decided to jump into the water. You have to remove it from your collection, if the index exists.
- "First/Last {count}":
- Print the first/last {count} frogs separated by a single space. If the count requested is more than the frogs- just print them to the end.
"{frog} {frog} {frog}"
- "Print Normal/Reversed"
- Print the names of the frogs in your collection in normal (in the order they have been added) or reversed order in the format described below, then stop the program:
"Frogs: {frog1} {frog2}… {frogn}"