Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40102 | wuxinyue | 菲波那契数列 | C++ | Compile Error | 0 MS | 0 KB | 278 | 2024-02-07 15:45:39 |
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; if(n==1 or n==2) cout << 1; else { int a = 1; int b = 1; int c; while(i <= n) { c = a + b; a = b; b = c; } i++; } return 0; }