Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- Visual Studio
- 오류
- label
- C++
- nvidia-smi
- pytorch
- VS Code
- C
- windows forms
- Linux
- paramiko
- pip
- SSH
- 핑거스타일
- ubuntu
- Selenium
- Python
- Numpy
- pandas
- 프로그래머스
- mysql
- 컨테이너
- Docker
- error
- 채보
- 기타 연주
- JSON
- OpenCV
- YOLO
- C#
Archives
- Today
- Total
목록이진 변환 반복하기 (1)
기계는 거짓말하지 않는다

프로그래머스 - 이진 변환 반복하기 문제 입니다. 문제 그대로 1인 문자 개수를 이진수로 변경하고 0인 문자를 계속 카운트 합니다. 이진수 문자열은 재귀함수를 사용했습니다. #include #include using namespace std; string binaryNumber(int n) { if(n < 2) return to_string(n); return binaryNumber(n / 2) + to_string(n % 2); } vector solution(string s) { vector answer; int zeroCnt = 0, tryCnt = 0, i = 0; int len = 0; while(s.length() != 1) { for(i = 0; i < s.length(); i++) { if..
Programming Test
2021. 4. 30. 16:01