文章目录 一、题目描述 二、解题思路 三、代码详解 1、正确解法1:迭代 2、正确解法2:递归 四、推荐专栏 五、习题练习 一、题目描述 循环输入,每输入一个正整数 n ( n ≤ 12 ) n (n \le 12) n(n≤