age = getAge(numPeople-1)+2;这个不会,请问为什么要减一
#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;
}