2진법1 [프로그래머스][C++][2단계] 이진 변환 반복하기 #include #include using namespace std; vector solution(string s) { vector answer; int num = 0; // 반복 횟수 int count = 0; // 제거된 0의 갯수 while(s != "1") { num++; // 모든 0 제거 string x; for(int i = 0; i 0) { bin += ((c % 2) + '0'); // 역순으로 저장됨 c /= 2; } // 역순 -> .. 2023. 11. 3. 이전 1 다음