전체 글 (454) 썸네일형 리스트형 [Level 2][C++] 올바른 괄호 #include#includeusing namespace std;bool solution(string s){ char* arr = new char[s.length()+1]; strcpy(arr, s.c_str()); //문자열 문자 배열에 복사 int count=0; for(int i=0; i [Level 2][C++] 다음 큰 숫자 #include using namespace std; int countOne(int number) //2진수로 바꿨을 때 1을 구하는 함수{ int count=0; while(number>0) { count = (number%2==1)? ++count: count; number /=2; } return count; } int solution(int n) { int nOne = countOne(n); int answer = n; while(true) { answer++; if(countOne(answer)==nOne) return answer;.. [Level 2][C++] 숫자의 표현 #include #include using namespace std;int solution(int n) { int answer = 0; for(int i=1; i 이전 1 2 3 4 5 6 7 8 ··· 152 다음