#include<stdio.h>
int age(int n)
{ int age;
if (n==1)
{age=10;
}
else { age=age(n-1)+2;
}
return age;
}
int main()
{
int n=5;
printf("第%d个人age是%d",n,age(5));
}
#include<stdio.h>
int age(int n)
{
int a;
if(n==1)
a= 10;
else
a= 2+age(n-1);
return a;
}
int main()
{
int n = 5;
printf("第%d个人age是%d",n,age(5));
}
谢谢大佬