求大神,哪里错了?
#include <stdio.h>
int getage(x)
int age;
{
if (x==1)
{
age=10;
return age;
}
else
{
age=getage (x-1)+2;
return age;
}
}
int main()
{
int fage=getage(5);
printf("第5个人的年龄是%d岁", fage);
return 0;
}
#include <stdio.h>
int getage(x)
int age;
{
if (x==1)
{
age=10;
return age;
}
else
{
age=getage (x-1)+2;
return age;
}
}
int main()
{
int fage=getage(5);
printf("第5个人的年龄是%d岁", fage);
return 0;
}
2019-08-24
举报