1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 15:48:42 +00:00
202401-programming-assignments/【实践课外】11.函数2/6-2 递归实现顺序输出整数.c

9 lines
196 B
C

int _printdigits_call_cnt = 0;
void printdigits(int n) {
if (n == 0 && _printdigits_call_cnt != 0) return;
_printdigits_call_cnt++;
printdigits(n / 10);
printf("%d\n", n % 10);
}