答案为什么是2呀!?写一下程序的运行过程。s最后不是指向了f吗?

有以下程序

#include

void fun ( int n,int *s )

{

int  f;
 
if(  n==1  )
 
    *s = n+1 ;
 
else
 
{
 
    fun( n-1, &f);
 
    *s = f;
 
}

}

main()

{

int  x =0;
 
fun( 4,&x );
 
printf("%d\n",x);

}

程序运行后的输出结果是()。

A
 
3
B
 
1
C
 
2
D
 
4

*s = f;这里只是=没有其他操作,因此递归一直到n==1,返回2之后,所有的f和s的值都是2了。