请问调用函数的时候为什么不能这样呢
#include <stdio.h>
int peopleage(n)
{
int age;
if(n==1)
age=10;
else
age=peopleage(n-1)+2;
return age;
}
int main()
{
int peopleage(5);
printf("第5个人的年龄是%d岁",peopleage(5));
return 0;
}
#include <stdio.h>
int peopleage(n)
{
int age;
if(n==1)
age=10;
else
age=peopleage(n-1)+2;
return age;
}
int main()
{
int peopleage(5);
printf("第5个人的年龄是%d岁",peopleage(5));
return 0;
}
2016-06-05
举报