C语言 s=fun(n-1)+2 我想知道 如果n=3 s=fun(2)+2 这句表示了什么int fun(int n){\x05int c;\x05if (n==1)\x05\x05c=10;\x05else\x05\x05c=fun(n-1)+2;(为什么会是14呢)\x05return c;}main(){\x05int a;\x05printf("\nPlease enter n:");\x05sca
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/09 08:34:45
![C语言 s=fun(n-1)+2 我想知道 如果n=3 s=fun(2)+2 这句表示了什么int fun(int n){\x05int c;\x05if (n==1)\x05\x05c=10;\x05else\x05\x05c=fun(n-1)+2;(为什么会是14呢)\x05return c;}main(){\x05int a;\x05printf(](/uploads/image/z/10128889-1-9.jpg?t=C%E8%AF%AD%E8%A8%80+s%3Dfun%28n-1%29%2B2+%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93+%E5%A6%82%E6%9E%9Cn%3D3+s%3Dfun%282%29%2B2+%E8%BF%99%E5%8F%A5%E8%A1%A8%E7%A4%BA%E4%BA%86%E4%BB%80%E4%B9%88int+fun%28int+n%29%7B%5Cx05int+c%3B%5Cx05if+%28n%3D%3D1%29%5Cx05%5Cx05c%3D10%3B%5Cx05else%5Cx05%5Cx05c%3Dfun%28n-1%29%2B2%3B%28%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BC%9A%E6%98%AF14%E5%91%A2%EF%BC%89%5Cx05return+c%3B%7Dmain%28%29%7B%5Cx05int+a%3B%5Cx05printf%28%22%5CnPlease+enter+n%3A%22%29%3B%5Cx05sca)
xOA&t?c/k:ivĄ4)ծ5D&RIEE!g'ghov{L{(N?:0XMYx͟7R{Nc)xekV@)ԟkgs,dUvT#3j#cieNRBT.kOUjD9fٕvшqB+3u7Of]kzhDHBO%(8A(1iOMS`i͉P$!RY8ɏWUK