这是哪儿错了啊?
#include <stdio.h> int age(people){ int age; if(people==1) { age =10; } else { Age=age(people-1)+2; } return Age;}int main() { int fifage=age(5); printf("第5个人的年龄是%d岁", fifage); return 0; }
#include <stdio.h>
int getAge(people)
{
int age;
if(people==1)
{
age =10;
}
else
{
age=getAge(people-1)+2;
}
return age;
}
int main()
{
int fifage=getAge(5);
printf("第5个人的年龄是%d岁", fifage);
return 0;
}