Problem | fibo |
---|---|
User | estkn |
Submission Time | 2025-03-14 14:01:51 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
fibo.cpp:3:120: error: expected unqualified-id before ‘for’
3 | using namespace std;int main() {int n;cin >> n;vector<long long> fib(n + 1); fib[0] = 0; if (n >= 1) ; fib[1] = 1;}for (int i = 2; i <= n; ++i) {fib[i] = (fib[i - 1] + fib[i - 2]);}for (int i = 0; i <= n; ++i) {cout << fib[i] <<endl;}return 0;}
| ^~~
fibo.cpp:3:136: error: ‘i’ does not name a type
3 | using namespace std;int main() {int n;cin >> n;vector<long long> fib(n + 1); fib[0] = 0; if (n >= 1) ; fib[1] = 1;}for (int i = 2; i <= n; ++i) {fib[i] = (fib[i - 1] + fib[i - 2]);}for (int i = 0; i <= n; ++i) {cout << fib[i] <<endl;}return 0;}
| ^
fibo.cpp:3:144: er