#4104. [GESP202509 七级 C++] 第 11 题

[GESP202509 七级 C++] 第 11 题

下面程序的输出为( )。

#include <iostream>
using namespace std;
int fib(int n) {
    if (n == 0)
        return 1;
    return fib(n - 1) + fib(n - 2);
}
int main() {
    cout << fib(6) << endl;
    return 0;
}

{{ select(1) }}

  • 8
  • 13
  • 21
  • 无法正常结束。