/*********************************************************************************************************
*函数内部定义的局部变量与全局变量重名时,函数在使用该变量的时候会以局部变量覆盖全局变量,也就是只有局部变量会起效果。
*********************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>
int n=5;
void fun(int m)
{
static int n=1;
if(m<10)
{
fun(m+1);
printf("%d ",n++);//打印 1 2 3 4 5 6 7
}
}
void test_print()
{
printf("%d\n",n);//打印5
}
int main()
{
int n;
scanf("%d",&n);//输入 3
printf("%d\n",n);//打印3
fun(n);
test_print();
return 0;
}