Problem-solving119 프로그래머스 - 자연수 뒤집어 배열로 만들기 (C++) 12345678910111213141516171819#include #include #include using namespace std; vector solution(long long n) { vector answer; string numbers_str = to_string(n); for(int i = 0; i 2020. 3. 12. 프로그래머스 - 자릿수 더하기 (C++) 12345678910111213141516171819#include #include using namespace std; int solution(int n){ int answer = 0; // 숫자를 문자열로 변환 string number_str = to_string(n); // 문자열의 각 자릿수를 다시 숫자로 변환하여 answer에 더함. for(int i = 0; i 2020. 3. 12. 프로그래머스 - 이상한 문자 만들기 (C++) 1234567891011121314151617181920212223242526272829303132333435363738394041424344#include #include using namespace std; // 짝수인덱스 -> 대문자// 홀수인덱스 -> 소문자 string solution(string s) { string answer = ""; // j는 단어의 인덱스 // i는 문자열 전체의 인덱스 for(int i = 0, j = 0; i 2020. 3. 12. 프로그래머스 - 약수의 합 (C++) 12345678910111213141516171819#include #include using namespace std; int solution(int n) { int answer = 0; for(int i = 1; i 2020. 3. 6. 이전 1 ··· 20 21 22 23 24 25 26 ··· 30 다음