代码练习
#include <iostream>
#include <vector>
using namespace std;
int n;
int main(void) {
scanf("%d", &n);
if (n == 1) return puts("0"), 0;
vector<int> nums(n);
nums[1] = 1;
for (int i = 2; i < n; ++i)
nums[i] = nums[i - 1] + nums[i - 2];
for (int i = 0; i < n; ++i)
printf("%d ", nums[i]);
return 0;
}