簡単 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用に調整されています。上記の説明と制約に従ってください。

他の人の解答から学ぶ

コミュニティの解答

まだ公開された解答がありません。この課題を解いて最初の解答を共有しましょう。