src2020/1667_houtao/Readme.md
2020-04-30 18:11:05 +08:00

20 lines
448 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 猴子吃桃子
[问题描述]
教学案例,必须使用递归函数完成求解!
  猴子吃桃子问题猴子第一天摘下若干个桃子当即吃了一半还不过瘾又多吃了一个第二天又将剩下的桃子吃掉一半又多吃了一个以后每天早上都吃了前一天剩下的一半零一个。到了第n天想再吃时见只剩下一个桃子求第一天共摘了多少个桃子
  1 <= n <= 50
[输入格式]
  一个整数值n。
[输出格式]
  第一天的桃子总数量。
[输入样例]
3
[输出样例]
10