求大神们,帮我分析一下这个程序怎么运行的
#include
void test(int n)
{
int x=0,i=0;
if(n==1){
printf("n:%d x:%d i:%d\n",n,x,i);
return ;
}else{
printf("n:%d x:%d i:%d\n",n,x,i);
for(i=0;i<3;i++){
test(n-1);
x=1;
}
}
}
int main()
{
test(3);
return 0;
}
运行结果如图: