帮我看看这个怎么错了
#include<stdio.h>
int ageprogram(int n)
{
int age;
if(n==1)
{
return 10;
}
else
{
age=ageprogram(n-1)+2;
}
}
int main()
{
int age;
age=ageprogram(5)
printf("第5个人的年龄是%d岁",age);
return 0;
}
#include<stdio.h>
int ageprogram(int n)
{
int age;
if(n==1)
{
return 10;
}
else
{
age=ageprogram(n-1)+2;
}
}
int main()
{
int age;
age=ageprogram(5)
printf("第5个人的年龄是%d岁",age);
return 0;
}
2020-12-21
举报