Adherencer
2016-02-13 17:49
#include <stdio.h>
int people(n)
{
{
int age;
if(n==1)
return 10;
}
else
{
age=(n-1)+2;
printf("第%d个人%d岁",n,age);
}
return age;
}
int main()
{
int 5age=people(5);
printf("第5个人的年龄是%d岁", 5age);
return 0;
}
#include <stdio.h>
int people(int n)//*******这里要注意有int**************
{
int age;
if(n==1)
{
age=10;
}
else
{
age=people(n-1)+2;
printf("第%d个人%d岁",n,age);
}
return age;
}
int main()
{
int 5age=people(5);
printf("第5个人的年龄是%d岁", 5age);
return 0;
}
#include <stdio.h>
int people(n)
{
int age;
if(n==1)
{
age=10;
}
else
{
age=people(n-1)+2;
printf("第%d个人%d岁",n,age);
}
return age;
}
int main()
{
int 5age=people(5);
printf("第5个人的年龄是%d岁", 5age);
return 0;
}
C语言入门
926210 学习 · 20797 问题
相似问题