题解 | #添加逗号#
添加逗号
https://www.nowcoder.com/practice/f51c317e745649c0900996fd3f683aed
#include <stdio.h> int count = 0; void Fun(int n) { if (n > 10) { count++; Fun(n / 10); } if (count % 3 == 0&&count!=0) { printf("%d", n % 10); printf(","); count--; } else { printf("%d", n % 10); count--; } } int main() { int n; scanf("%d", &n); Fun(n); return 0; }#利用递归写的#