나이 출력

canyi·2023년 2월 19일
0

프로그래머스

목록 보기
10/17
post-thumbnail

문제링크
https://school.programmers.co.kr/learn/courses/30/lessons/120820

나의 풀이

#include <string>
#include <vector>

using namespace std;

int solution(int age) {
    int answer = 2023;
    answer = answer - age;
    return answer;
}

남의 풀이

#include <string>
#include <vector>

using namespace std;

int solution(int age) {
    int answer = 0;
    return 2022 - age + 1;
}
profile
백엔드 개발 정리

0개의 댓글