#프로그래머스 #기초트레이닝 #C++ 13

프로그래머스 - 주사위 게임 3 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/181916 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; int solution(int a, int b, int c, int d) { int answer = 0; int ans[6]={0,}; ans[a-1]++; ans[b-1]++; ans[c-1]++; ans[d-1]++; int max=-1; int maxId=-1; int min=7; for(int i=0;i

프로그래머스 - 왼쪽 오른쪽 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/181890?language=cpp 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; vector solution(vector s) { vector answer; for (int i = 0; i < s.size(); i++) { if (s[i] == "l" || s[i] == "r") { if (s[i] == "l") { if (i == 0)return answer; for (int j ..

프로그래머스 - 두 수의 합 - C++

https://school.programmers.co.kr/learn/courses/30/lessons/181846 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include using namespace std; string solution(string a, string b) { string answer = ""; int i; bool ch = false; reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); for (i = 0; i < a.length(..