Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- cs
- 백준
- 오퍼레이팅시스템
- vector
- 컴공
- coding
- 문제풀이
- 코딩
- bfs
- c++
- Operating System
- Computer science
- 브루트포스
- 정석
- 북리뷰
- 알고리즘
- 스택
- 오에스
- 코테
- 컴퓨터공학과
- 컴공과
- 자료구조
- 개발
- DP
- 너비우선탐색
- 구현
- 그래프
- OS
- 정석학술정보관
- Stack
Archives
- Today
- Total
Little Jay
[C++] 백준 2747번 피보나치 수 본문
간단한 피보나치 문제
재귀를 아마 못쓰는 문제인 것 같다
#include <iostream>
using namespace std;
int main() {
int first = 0;
int second = 1;
int input;
cin >> input;
for (int i = 1; i < input; i++) {
int third = first + second;
first = second;
second = third;
}
cout << second << "\n";
}
'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 2908번 상수 (0) | 2021.03.01 |
|---|---|
| [C++] 백준 1267번 핸드폰 요금 (0) | 2021.02.28 |
| [C++] 백준 2693번 N번째 큰 수 (0) | 2021.02.28 |
| [C++] 백준 3507번 Automated Telephone Exchange (0) | 2021.02.27 |
| [C++] 백준 18108번 1998년생인 내가 태국에서는 2541년생?! (0) | 2021.02.27 |
Comments