题目
题目

IS 4485-001 Fall 2025 Final Exam

单项选择题

What will this recursive function print when called with countdown(3)?

选项
A.1 2 3
B.Blastoff! 1 2 3
C.0 1 2 3
D.3 3 3 Blastoff!
E.Nothing
F.3 2 1 Blastoff!
题目图片
查看解析

查看解析

标准答案
Please login to view
思路分析
First, let's lay out what the function does step by step. The function countdown(n) checks if n is 0; if so, it prints 'Blastoff!'. Otherwise, it prints the current value of n, then recursively calls countdown(n-1). This means the numbers will be printed in decreasing order from n down to 1, and then 'Blastoff!' when the base ......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!