为什么不对

hebaijun 2024-07-16 13:25:04 12

#include <bits/stdc++.h> using namespace std; int main() { int n, a[30] = { 1, 2 }; for (int i = 2; i < 35; i++) { a[i] = a[i - 1] + a[i - 2]; } while (cin >> n) { cout << a[n - 1] << endl; } return 0; } 为什么是紫色炸弹

{{ vote && vote.total.up }}

共 1 条回复

root 站长

数组开小了,最起码开 36