文件名称:递归解决年龄问题
介绍说明--下载内容均来自于网络,请自行研究使用
有5个人坐在一起,问第5个人多少岁,他说比第4个人大2岁。问第4个人多少岁,他说比第3个人大2岁。问第3人多少岁,他说比第2个人大2岁。问第2个人多少岁,他说比第1个人大2岁。最后问第1个人,他说他是10岁。编写程序,当输入第几个人时求出其对应的年龄。(5 people sat together and asked how old fifth people were. He said he was 2 years older than fourth. Asked how old fourth people, he said, 2 years older than third people. Asked how old the third were, he said, 2 years older than second. Asked how old second people, he said, 2 years older than first people. Finally asked first people, he said he was 10 years old. Write a program to determine the age when you enter the first few.)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
递归解决年龄问题.txt
提示.txt
提示.txt