#include <stdio.h>
int getAge(numPeople)
{
int age;
if(numPeople==1)
age=10;
else
age = getAge(numPeople-1)+2;
return age;
}
int main()
int fifthAge = getAge(5);
printf("第5个人的年龄是%d岁", fifthAge);
return 0;
因为每个人(除了第一个)都说他比前一人大两岁,所以需要减一,