250x250
반응형
Notice
Recent Posts
Recent Comments
Link
목록월간 코드 챌린지 (1)
N
(프로그래머스 c++)없는 숫자 더하기
https://programmers.co.kr/learn/courses/30/lessons/86051 코딩테스트 연습 - 없는 숫자 더하기 0부터 9까지의 숫자 중 일부가 들어있는 배열 numbers가 매개변수로 주어집니다. numbers에서 찾을 수 없는 0부터 9까지의 숫자를 모두 찾아 더한 수를 return 하도록 solution 함수를 완성해주세요. 제한 programmers.co.kr 0 ~ 9의 숫자의 총합은 45다. numbers 벡터에서 없는 숫자의 총합이기 때문에, numbers의 원소를 빼면 답이다. #include #include using namespace std; int solution(vector numbers) { int answer = 45; for(int i = 0; i <..
프로그래머스 알고리즘/1단계
2021. 10. 7. 11:20