c++86 [프로그래머스] 공백으로 구분하기 2(c++) https://school.programmers.co.kr/learn/courses/30/lessons/181868 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 답 #include #include using namespace std; vector solution(string my_string) { vector answer; string temp=""; for(int i=0;i 2024. 1. 13. [프로그래머스] 두 수의 합(c++) https://school.programmers.co.kr/learn/courses/30/lessons/181846 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 답 #include using namespace std; string solution(string a, string b) { string answer; int carry=0; int temp; if(a.size()>b.size()){ b.insert(0,a.size()-b.size(),'0'); } else if(a.size()=0;i--){ temp=(a[i]-'0')+(b[i]-'0')+ca.. 2024. 1. 13. [프로그래머스] 정수를 나선형으로 배치하기(c++) https://school.programmers.co.kr/learn/courses/30/lessons/181832 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 답 #include #include using namespace std; vector solution(int n) { vector answer(n,vector(n,0)); int count=1; int m=n; int x=0,y=-1; while (m>0) { for (int i=0;i 2024. 1. 13. [프로그래머스] 그림 확대(c++) https://school.programmers.co.kr/learn/courses/30/lessons/181836 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 답 #include #include using namespace std; vector solution(vector picture, int k) { vector answer; string temp; for(int i=0;i 2024. 1. 12. [프로그래머스] 문자열 정수의 합(c++) https://school.programmers.co.kr/learn/courses/30/lessons/181849 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 답 #include #include using namespace std; int solution(string num_str) { int answer = 0; for(int i=0;i 2023. 12. 27. [프로그래머스] 문자열의 뒤의 n글자(c++) https://school.programmers.co.kr/learn/courses/30/lessons/181910 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 답 #include #include using namespace std; string solution(string my_string, int n) { string answer; answer+=my_string.substr(my_string.size()-n,my_string.size()); return answer; } string answer을 만들어준다. substr을 사용해서 my_strin.. 2023. 12. 27. 이전 1 ··· 3 4 5 6 7 8 9 ··· 15 다음