Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
111945 宋春霖 爬楼梯 C++ Accepted 100 0 MS 248 KB 12328 2023-11-25 09:15:16

Tests(3/3):


#include<bits/stdc++.h> using namespace std; int a[105]; int main(){ int n; cin >> n; a[1] = 1; a[2] = 2; for (int i = 3; i <= n; i++){ a[i] = a[i - 1] + a[i - 2]; } cout << a[n]; }


Judgement Protocol: