找不到错误??? #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; }
无法输出代码 有什么错误吗
#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;
}