正在加载图片...
maind 上一题的分析 int f(int n); printf(" resulte A[5=%d, f(5);3 18 第一次调用 int f(int n if n )c=10; 注意:函数调用的次序。函数 ls f(n-1)+2; 调用完毕后,回到上一步的调 第二次调用m;}4|16 用点处。 f(i if(n=1)c=10 else c=f(n-1)+2; return 第三次调用 c;}3↑14 int f(int n) ir(m=+1)c=10 else c=f(n-1)+2; 第四次调用 return c; 12 int f(int h) 第五次调用 int if(m=+1)c=10 int f(int f(n-1)+2; Int c; return c;}1↑10 if(m=1)c=10; 第五次调用 Ise c=f(n-1)+2 return c;main() 上一题的分析 {int f(int n); printf(“ resulte A[5]=%d”,f(5));} int f(int n) {int c; if (n==1) c=10; else c=f(n-1)+2; return c; } int f(int n) {int c; if (n==1) c=10; else c=f(n-1)+2; return c; } 4 int f(int n) {int c; if (n==1) c=10; else c=f(n-1)+2; return c; } int f(int n) {int c; if (n==1) c=10; else c=f(n-1)+2; return c; } 3 2 int f(int n) {int c; if (n==1) c=10; else c=f(n-1)+2; return c; } 1 1 10 10 12 14 16 18 5 注意: 函数调用的次序。函数 调用完毕后,回到上一步的调 用点处。 第一次调用 第二次调用 第三次调用 第四次调用 第五次调用 第五次调用
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有