Loading...
Loading...
Loading...
The school science club is launching a water rocket. The teacher types a starting number n. Count down from n to 1, one number per line, and then print Lift-off!.
If n is 0, there is nothing to count, so print only Lift-off!.
Lift-off!.Example
Input
5
Output
5 4 3 2 1 Lift-off!
Five numbers going down, then the launch line.
Try the problem first. Open one hint at a time.
Keep n as the counter. Print it, then make it one smaller.
Loop while n is at least 1. When the loop ends, print the last line once, outside the loop.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor