전체 글 (454) 썸네일형 리스트형 [Level 1][C++] 이상한 문자 만들기 #include #include #include using namespace std;string solution(string s) { int count = 1; char * arr = new char[s.length() + 1]; strcpy(arr, s.c_str()); for (int i = 0; i [Level 1][C++] 자릿수 더하기 #include #include #include using namespace std;int solution(int n){ string s = to_string(n); int answer = accumulate(s.begin(), s.end(),0)-'0'*s.size(); // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. cout [Level 1][C++] 최대공약수와 최소공배수 #include #include using namespace std;vector solution(int n, int m) { int max = (n>m)? n:m; int min = (n0; i--) if(max%i ==0 && min%i ==0) return{i, max*min/i}; } } 이전 1 ··· 10 11 12 13 14 15 16 ··· 152 다음