Все задачи
Легко Решено: 0 Процент решений: 0%

Countdown to Liftoff

Count down from a number and end with Liftoff!

Условие

Count down from start to 1, then add "Liftoff!". Each number becomes one text entry.

Implement countdown(start).

Input

start: The number to start counting down from.

Output

Return the countdown as a list of strings, ending with "Liftoff!".

Ограничения

0 ≤ start ≤ 1,000

Примеры

Пример 1
Ввод:
start = 3

Ожидаемый вывод:
expected = ["3", "2", "1", "Liftoff!"]
Ввод:
long long start = 3;

Ожидаемый вывод:
std::vector<std::string> expected = {"3", "2", "1", "Liftoff!"};
Ввод:
long start = 3;

Ожидаемый вывод:
string[] expected = new string[] {"3", "2", "1", "Liftoff!"};

Пояснение

"3", "2", "1", then "Liftoff!".

Пример 2
Ввод:
start = 0

Ожидаемый вывод:
expected = ["Liftoff!"]
Ввод:
long long start = 0;

Ожидаемый вывод:
std::vector<std::string> expected = {"Liftoff!"};
Ввод:
long start = 0;

Ожидаемый вывод:
string[] expected = new string[] {"Liftoff!"};

Пояснение

There is nothing to count, so only "Liftoff!" remains.

Ссылки

Это задание адаптировано для CodeUtility. Следуйте условию и ограничениям выше.

Учитесь у других

Решения сообщества

Пока нет опубликованных решений. Решите задание, чтобы поделиться первым.