题解 | #Fibonacci#
Fibonacci
https://www.nowcoder.com/practice/17ad6908e36a49f4b06ea96936e8bb25
#include <iostream> using namespace std; int F(int N) { if (N == 0 || N == 1) return N; return F(N - 1) + F(N - 2); } int main() { int N; while (scanf("%d", &N) != EOF) { cout << F(N); } return 0; }