1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> using namespace std; void Convert2Bin(int dec) { if (dec <= 0) return; Convert2Bin(dec / 2); cout << dec % 2; } int main() { Convert2Bin(13); cout << "\n"; return 0; } | cs |