#include <iostream>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector<long long int> dp(100);
dp[0] = 0;
dp[1] = 1;
for (int i = 2; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}
cout << dp[n];
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 10950๋ฒ - A+B-3 (0) | 2021.10.25 |
---|---|
[๋ฐฑ์ค,c++] 10872๋ฒ - ํฉํ ๋ฆฌ์ผ (0) | 2021.10.25 |
[๋ฐฑ์ค,c++] 10871๋ฒ - X๋ณด๋ค ์์ ์ (0) | 2021.10.25 |
[๋ฐฑ์ค,c++] 10867๋ฒ - ์ค๋ณต ๋นผ๊ณ ์ ๋ ฌํ๊ธฐ (0) | 2021.10.25 |
[๋ฐฑ์ค,c++] 10866๋ฒ - ๋ฑ (0) | 2021.10.25 |
[๋ฐฑ์ค,c++] 10845๋ฒ - ํ (0) | 2021.10.25 |
๋๊ธ