#include <stdio.h>
int qiuNianLing(int n);
int main(int argc, const char * argv[])
{
printf("请输入你要求的人的次数:\n");
int n = 0;
scanf("%d", &n);
// qiuNianLing(n);
printf("第%d个人的年龄为:%d", n, qiuNianLing(n));
return 0;
}
int qiuNianLing(int n)
{
//定义变量存储结果
// int result = 0;
if(n == 1) return 10;
return qiuNianLing(n - 1) + 2;
} |