#include <stdio.h>
// 循环
void printN(int n)
{
int mod = 0;
while ((mod = n % 10) != 0) {
printf("%d\n", mod);
n = n / 10;
}
}
// 递归
void printn(int n)
{
printf("%d\n", n % 10);
if(n>=10)
printn(n/10);
}
int main(int argc, const char * argv[]) {
printn(12345);
return 0;
}
标签:输出,递归,10,int,void,循环,mod,printn
From: https://www.cnblogs.com/zxhoo/p/17602977.html