这个有什么问题吗?
int getAge(numPeople)
{
int age;
if(numberPeople==1)
age=10;
else
age=getAge(numPeople-1)+2;
return age;
}
int main()
{
int fifthAge=getAge(5);
printf("第五个人的年龄是%d岁",fifthAge);
return 0;
}
int getAge(numPeople)
{
int age;
if(numberPeople==1)
age=10;
else
age=getAge(numPeople-1)+2;
return age;
}
int main()
{
int fifthAge=getAge(5);
printf("第五个人的年龄是%d岁",fifthAge);
return 0;
}
2019-12-09
举报