请问哪里错了?
#include <stdio.h>
int getage(n)
{
int age;
if(n==1)
age= 10;
}
else
{
age = getage(n-1)+2;
return age;
}
int main()
{
int fifthage=getage(5);
printf("第5个人的年龄是%d岁", fifthage);
return 0;
}
#include <stdio.h>
int getage(n)
{
int age;
if(n==1)
age= 10;
}
else
{
age = getage(n-1)+2;
return age;
}
int main()
{
int fifthage=getage(5);
printf("第5个人的年龄是%d岁", fifthage);
return 0;
}
2020-10-27
举报