1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【实践课内】11.函数2/6-3 十进制转换二进制.c

9 lines
184 B
C
Raw Permalink Normal View History

2024-11-22 08:22:46 +00:00
int _dectobin_call_count = 0;
void dectobin(int n) {
if (n == 0 && _dectobin_call_count != 0) return;
_dectobin_call_count++;
dectobin(n >> 1);
printf("%d", n & 1);
}