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
- Class
- implement
- dynamic programming
- simulation
- 코딩테스트
- Stack
- two pointers
- 구현
- Counting
- java
- Number Theory
- hash table
- greedy
- string
- database
- 자바
- Tree
- 코테
- Data Structure
- array
- Binary Search
- Matrix
- SQL
- 파이썬
- geometry
- sorting
- bit manipulation
- Math
- Binary Tree
- Method
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 나이 출력 본문
1. Input
1) 나이 age
2. Output
1) 2022년 기준 나이가 age인 사람의 출생 연도
3. Constraint
1) 0 < age <= 120
2) 나이는 태어난 연도에 1살
3) 나이는 1년마다 1씩 증가
4. Example
Input: age=40 -> Output: 1983
5. Code
1) 첫 코드(2022/10/17)
return 2022 - age + 1;
2) 수정 코드(2022/10/17)
int year = 2022;
return year - age + 1;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 문자열 뒤집기 (0) | 2022.10.21 |
---|---|
[프로그래머스/Lv.0] 배열 뒤집기 (0) | 2022.10.20 |
[프로그래머스/Lv.0] 아이스 아메리카노 (0) | 2022.10.20 |
[프로그래머스/Lv.0] 옷가게 할인 받기 (0) | 2022.10.20 |
[프로그래머스/Lv.0] 최빈값 구하기 (0) | 2022.10.19 |