|
|
back to boardWhy RA 12? #include <iostream> using namespace std; int main() { int n; cin >> n; long a = 1; long b = 1; long ans = 0; if(n == 1 || n == 2){ ans = 1; } else { while (n - 2 > 0){ ans = a + b; a = b; b = ans; n--; } }
cout << 2 * ans; return 0; } |
|
|