问题
填空题
阅读下面程序:
#include <iostream.h>
long fib(int n)if (n>2)
return (fib(n-1) + fib(n-2));
else
return (2);void main()cout<<fib(3)<<end1;则该程序的输出结果应该是 【12】 。
答案
参考答案:D
阅读下面程序:
#include <iostream.h>
long fib(int n)if (n>2)
return (fib(n-1) + fib(n-2));
else
return (2);void main()cout<<fib(3)<<end1;则该程序的输出结果应该是 【12】 。
参考答案:D