#include <iostream> using namespace std; int main() { int n; int fibo[40]; fibo[0] = 0; fibo[1] = 1; while (scanf("%d", &n) != EOF) { // 注意 while 处理多个 case for(int i = 2; i <= n; i++){ fibo[i] = fibo[i - 1] + fibo[i - 2]; } printf("%d\n", fibo[n]); } } // 64 位输出请用 printf("%lld")