#include <stdio.h> void splnum(int n) { char num; if (n == 0) return; splnum(n / 10); num = n % 10+ '0'; //将数字转化为字符 putchar(num); } int main() { int nub; printf("请输入一个整数:\n"); scanf_s("%d", &nub); splnum(nub); return 0; }
2024-03-27 09:47:04
#include <stdio.h> void splnum(int n) { char num; if (n == 0) return; splnum(n / 10); num = n % 10+ '0'; //将数字转化为字符 putchar(num); } int main() { int nub; printf("请输入一个整数:\n"); scanf_s("%d", &nub); splnum(nub); return 0; }