代码有问题,求改正
#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 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));
}
2017-11-07
举报