السابق التالي
0 / 18
الوحدة النمطية DEMO-32-90DEMO-C-32

Countdown Printer

DEMO-C-32 • Programming in C

Browser-only practice

بيان المشكلة

Write a function void countdown(int start) that prints a countdown from the number `start` down to 0.

After 0, it should print "Blastoff!".

Each number and the final string should be on a new line.

قيود

Start will be between 0 and 100.

تنسيق الإدخال

A single non-negative integer.

تنسيق الإخراج

Numbers from start to 0, followed by "Blastoff!".

حالات اختبار نموذجية

Submit runs every public testcase in this browser. Results and code never leave this device.

العينة رقم 1
عينة ظاهرة
3
3
2
1
0
Blastoff!
Counting down from 3.
العينة رقم 2
عينة ظاهرة
2
2
1
0
Blastoff!
Counting down from 2.
العينة رقم 3
عينة ظاهرة
0
0
Blastoff!
Counting down from 0.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
إعدادات المحرر